aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-18 17:56:28 +0000
committerDan Gohman <gohman@apple.com>2009-04-18 17:56:28 +0000
commit890f92b744fb074465bc2b7006ee753a181f62a4 (patch)
tree0300a386e2f78a01341f5351e32841c9f4349db0 /lib/Transforms/Scalar/IndVarSimplify.cpp
parentf34c921713111fb327623400cf8c23d322513790 (diff)
Use more const qualifiers with SCEV interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 01c9574123..42fb9b9147 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -98,7 +98,7 @@ namespace {
BasicBlock *ExitingBlock,
BranchInst *BI,
SCEVExpander &Rewriter);
- void RewriteLoopExitValues(Loop *L, SCEV *BackedgeTakenCount);
+ void RewriteLoopExitValues(Loop *L, const SCEV *BackedgeTakenCount);
void DeleteTriviallyDeadInstructions(SmallPtrSet<Instruction*, 16> &Insts);
@@ -211,7 +211,8 @@ void IndVarSimplify::LinearFunctionTestReplace(Loop *L,
/// final value of any expressions that are recurrent in the loop, and
/// substitute the exit values from the loop into any instructions outside of
/// the loop that use the final values of the current expressions.
-void IndVarSimplify::RewriteLoopExitValues(Loop *L, SCEV *BackedgeTakenCount) {
+void IndVarSimplify::RewriteLoopExitValues(Loop *L,
+ const SCEV *BackedgeTakenCount) {
BasicBlock *Preheader = L->getLoopPreheader();
// Scan all of the instructions in the loop, looking at those that have
@@ -627,7 +628,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// polynomial evaluations inside of the loop, and the str reduction pass
// currently can only reduce affine polynomials. For now just disable
// indvar subst on anything more complex than an affine addrec.
- if (SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV))
+ if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(SCEV))
if (AR->getLoop() == L && AR->isAffine())
IndVars.push_back(std::make_pair(PN, SCEV));
}
@@ -716,7 +717,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// variable.
while (!IndVars.empty()) {
PHINode *PN = IndVars.back().first;
- SCEVAddRecExpr *AR = cast<SCEVAddRecExpr>(IndVars.back().second);
+ const SCEVAddRecExpr *AR = cast<SCEVAddRecExpr>(IndVars.back().second);
Value *NewVal = Rewriter.expandCodeFor(AR, PN->getType(), InsertPt);
DOUT << "INDVARS: Rewrote IV '" << *AR << "' " << *PN
<< " into = " << *NewVal << "\n";