On Nov 2, 2006, at 3:33 PM, Reid Spencer wrote:
*** In LangRef.html, please make the "Overview" sections of each instr mention the word "logical" or "arithmetic". *** In a follow-on patch, please replace all uses of ConstantExpr::get[US]Shr with ConstantExpr::get[LA]Shr. Please do this after committing this patch though, to ease review. *** I should have asked for this before, but in CWriter::printConstExprCast, please name 'result' something more useful, like "NeedsExplicitCast" or something. likewise in writeInstructionCast. *** In SROA::ConvertUsesToScalar, the shift should always be a logical shift. Since the top bits are truncated away, it doesn't matter which one you use and lshr is cheaper. *** In ConstantFolding.cpp, all of these cases: static Constant *Shl(const ConstantPacked *V1, const ConstantPacked *V2) { return EvalVectorOp(V1, V2, ConstantExpr::getShl); } - static Constant *Shr(const ConstantPacked *V1, const ConstantPacked *V2) { - return EvalVectorOp(V1, V2, ConstantExpr::getShr); + static Constant *LShr(const ConstantPacked *V1, const ConstantPacked *V2) { + return EvalVectorOp(V1, V2, ConstantExpr::getLShr); + } + static Constant *AShr(const ConstantPacked *V1, const ConstantPacked *V2) { + return EvalVectorOp(V1, V2, ConstantExpr::getAShr); } are dead, because we don't support shifting of vectors. *** In ConstantFolding.cpp, this comment is incorrect: + case Instruction::AShr: + if (!isa<UndefValue>(V2)) + return const_cast<Constant*>(V1); // undef ashr X --> X It is actually "... --> undef". Otherwise, looks good. -Chris |
_______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits