aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 1059159aad..cd674ae4b6 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/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));
}
}