Use SCEVConstant::get instead of SCEVUnknown::get to create an
authorDan Gohman <gohman@apple.com>
Fri, 15 Jun 2007 18:00:55 +0000 (18:00 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 15 Jun 2007 18:00:55 +0000 (18:00 +0000)
integer constant SCEV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37596 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/IndVarSimplify.cpp

index 5965d1a88559b70866328815a1d3826b136396ec..2558fe15d11e9f6bd1de99b797417019f08cf12c 100644 (file)
@@ -264,8 +264,8 @@ Instruction *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
     // The IterationCount expression contains the number of times that the
     // backedge actually branches to the loop header.  This is one less than the
     // number of times the loop executes, so add one to it.
-    Constant *OneC = ConstantInt::get(IterationCount->getType(), 1);
-    TripCount = SCEVAddExpr::get(IterationCount, SCEVUnknown::get(OneC));
+    ConstantInt *OneC = ConstantInt::get(IterationCount->getType(), 1);
+    TripCount = SCEVAddExpr::get(IterationCount, SCEVConstant::get(OneC));
     IndVar = L->getCanonicalInductionVariableIncrement();
   } else {
     // We have to use the preincremented value...