[llvm-commits] [llvm] r69291 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Dan Gohman
gohman at apple.com
Thu Apr 16 08:48:38 PDT 2009
Author: djg
Date: Thu Apr 16 10:48:38 2009
New Revision: 69291
URL: http://llvm.org/viewvc/llvm-project?rev=69291&view=rev
Log:
Use ConstantExpr::getIntToPtr instead of SCEVExpander::InsertCastOfTo,
since the operand is always a constant.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=69291&r1=69290&r2=69291&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Apr 16 10:48:38 2009
@@ -2118,9 +2118,8 @@
if (!isa<PointerType>(NewCmpTy))
NewCmpRHS = ConstantInt::get(NewCmpTy, NewCmpVal);
else {
- NewCmpRHS = ConstantInt::get(UIntPtrTy, NewCmpVal);
- NewCmpRHS = SCEVExpander::InsertCastOfTo(Instruction::IntToPtr,
- NewCmpRHS, NewCmpTy);
+ ConstantInt *CI = ConstantInt::get(UIntPtrTy, NewCmpVal);
+ NewCmpRHS = ConstantExpr::getIntToPtr(CI, NewCmpTy);
}
NewOffset = TyBits == NewTyBits
? SE->getMulExpr(CondUse->Offset,
More information about the llvm-commits
mailing list