diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index f529281be1..3368f2acd7 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -522,11 +522,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) { DOUT << "INDVARS: New CanIV: " << *IndVar; if (!isa<SCEVCouldNotCompute>(IterationCount)) { - if (IterationCount->getType()->getPrimitiveSizeInBits() < - LargestType->getPrimitiveSizeInBits()) - IterationCount = SE->getZeroExtendExpr(IterationCount, LargestType); - else if (IterationCount->getType() != LargestType) - IterationCount = SE->getTruncateExpr(IterationCount, LargestType); + IterationCount = SE->getTruncateOrZeroExtend(IterationCount, LargestType); if (Instruction *DI = LinearFunctionTestReplace(L, IterationCount,Rewriter)) DeadInsts.insert(DI); } |