From eed707b1e6097aac2bb6b3d47271f6300ace7f2e Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 24 Jul 2009 23:12:02 +0000 Subject: Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp') diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 22717c21d4..4a6fe575f3 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1991,9 +1991,9 @@ ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond, NewStride = &IU->StrideOrder[i]; if (!isa(NewCmpTy)) - NewCmpRHS = Context.getConstantInt(NewCmpTy, NewCmpVal); + NewCmpRHS = ConstantInt::get(NewCmpTy, NewCmpVal); else { - Constant *CI = Context.getConstantInt(NewCmpIntTy, NewCmpVal); + Constant *CI = ConstantInt::get(NewCmpIntTy, NewCmpVal); NewCmpRHS = Context.getConstantExprIntToPtr(CI, NewCmpTy); } NewOffset = TyBits == NewTyBits @@ -2432,8 +2432,6 @@ void LoopStrengthReduce::OptimizeLoopCountIV(Loop *L) { if (!ExitingBlock) return; // More than one block exiting! - LLVMContext &Context = ExitingBlock->getContext(); - // Okay, we've computed the exiting block. See what condition causes us to // exit. // @@ -2506,7 +2504,7 @@ void LoopStrengthReduce::OptimizeLoopCountIV(Loop *L) { Value *startVal = phi->getIncomingValue(inBlock); Value *endVal = Cond->getOperand(1); // FIXME check for case where both are constant - Constant* Zero = Context.getConstantInt(Cond->getOperand(1)->getType(), 0); + Constant* Zero = ConstantInt::get(Cond->getOperand(1)->getType(), 0); BinaryOperator *NewStartVal = BinaryOperator::Create(Instruction::Sub, endVal, startVal, "tmp", PreInsertPt); -- cgit v1.2.3-70-g09d2