summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 1059159aadc..cd674ae4b60 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -523,9 +523,8 @@ void IndVarSimplify::runOnLoop(Loop *L) {
if (!InsertedSizes[IndVars[i].first->getType()->getPrimitiveSize()]) {
PHINode *PN = IndVars[i].first;
InsertedSizes[PN->getType()->getPrimitiveSize()] = true;
- Instruction *New = new CastInst(IndVar,
- PN->getType()->getUnsignedVersion(),
- "indvar", InsertPt);
+ Instruction *New = CastInst::create(Instruction::Trunc, IndVar,
+ PN->getType()->getUnsignedVersion(), "indvar", InsertPt);
Rewriter.addInsertedValue(New, SE->getSCEV(New));
}
}
OpenPOWER on IntegriCloud