aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorWojciech Matyjewicz <wmatyjewicz@fastmail.fm>2008-06-13 17:02:03 +0000
committerWojciech Matyjewicz <wmatyjewicz@fastmail.fm>2008-06-13 17:02:03 +0000
commitc561c13f16b683f59086eb1decddd014117cffff (patch)
tree638412f827ce99101f662fc3cf1fc769e3b5cd21 /lib
parent2035efd1cc1e191b15db1844ab1658c235ee682f (diff)
downloadexternal_llvm-c561c13f16b683f59086eb1decddd014117cffff.zip
external_llvm-c561c13f16b683f59086eb1decddd014117cffff.tar.gz
external_llvm-c561c13f16b683f59086eb1decddd014117cffff.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index f529281..3368f2a 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);
}