summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit25a7f5de926236760967e0ebc50f0bac294b6d02 (patch)
treead0bbe174798433841794cc98f13e79a7613fb51 /llvm/lib/Transforms
parentc5d12eb3180261f3af81d1d52281fa148b9bf153 (diff)
downloadbcm5719-llvm-25a7f5de926236760967e0ebc50f0bac294b6d02.tar.gz
bcm5719-llvm-25a7f5de926236760967e0ebc50f0bac294b6d02.zip
Use recently added getTruncateOrZeroExtend method to make the code shorter.
llvm-svn: 52251
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index f529281be1b..3368f2acd71 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud