diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-04 22:02:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-04 22:02:23 +0000 |
commit | 622ed671b90d449496d582b3a03c7aad1e98324a (patch) | |
tree | 25d5af646c71b51fc300bdd8782822d8f8ad45a1 /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | 7d04e4a7c0a803bc7ab04986ad184291338f42da (diff) |
Constify a bunch of SCEV-using code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index b940665152..50603d9757 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -321,7 +321,7 @@ static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L, // for a nested AddRecExpr. if (const SCEVAddExpr *AE = dyn_cast<SCEVAddExpr>(SH)) { for (unsigned i = 0, e = AE->getNumOperands(); i != e; ++i) - if (SCEVAddRecExpr *AddRec = + if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(AE->getOperand(i))) { if (AddRec->getLoop() == L) TheAddRec = SE->getAddExpr(AddRec, TheAddRec); @@ -1400,8 +1400,8 @@ bool LoopStrengthReduce::ShouldUseFullStrengthReductionMode( // Iterate through the uses to find conditions that automatically rule out // full-lsr mode. for (unsigned i = 0, e = UsersToProcess.size(); i != e; ) { - SCEV *Base = UsersToProcess[i].Base; - SCEV *Imm = UsersToProcess[i].Imm; + const SCEV *Base = UsersToProcess[i].Base; + const SCEV *Imm = UsersToProcess[i].Imm; // If any users have a loop-variant component, they can't be fully // strength-reduced. if (Imm && !Imm->isLoopInvariant(L)) @@ -1410,7 +1410,7 @@ bool LoopStrengthReduce::ShouldUseFullStrengthReductionMode( // the two Imm values can't be folded into the address, full // strength reduction would increase register pressure. do { - SCEV *CurImm = UsersToProcess[i].Imm; + const SCEV *CurImm = UsersToProcess[i].Imm; if ((CurImm || Imm) && CurImm != Imm) { if (!CurImm) CurImm = SE->getIntegerSCEV(0, Stride->getType()); if (!Imm) Imm = SE->getIntegerSCEV(0, Stride->getType()); |