From: Wojciech Matyjewicz Date: Fri, 13 Jun 2008 17:02:03 +0000 (+0000) Subject: Use recently added getTruncateOrZeroExtend method to make the code shorter. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=900872186d57468038726a01290f5cd49a45537c;p=oota-llvm.git Use recently added getTruncateOrZeroExtend method to make the code shorter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52251 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index f529281be1b..3368f2acd71 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(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); }