diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-16 15:39:27 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-16 15:39:27 +0000 |
| commit | 9b7632df26ae419aa28a75a5156410ba39e08e8d (patch) | |
| tree | e247da79bbcb4e368857fc887ab5608eade0b194 /llvm/lib | |
| parent | f99ba9671ece673a5fb225300dbaa2278b4fdab4 (diff) | |
| download | bcm5719-llvm-9b7632df26ae419aa28a75a5156410ba39e08e8d.tar.gz bcm5719-llvm-9b7632df26ae419aa28a75a5156410ba39e08e8d.zip | |
Put add operands in ScalarEvolution-canonical order, when convenient.
This isn't necessary, because ScalarEvolution sorts them anyway,
but it's tidier this way.
llvm-svn: 111132
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index a040e8acc7d..95e25dd76c9 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1601,7 +1601,7 @@ ICmpInst *LSRInstance::OptimizeMax(ICmpInst *Cond, IVStrideUse* &CondUse) { const SCEV *One = SE.getConstant(BackedgeTakenCount->getType(), 1); // Add one to the backedge-taken count to get the trip count. - const SCEV *IterationCount = SE.getAddExpr(BackedgeTakenCount, One); + const SCEV *IterationCount = SE.getAddExpr(One, BackedgeTakenCount); if (IterationCount != SE.getSCEV(Sel)) return Cond; // Check for a max calculation that matches the pattern. There's no check @@ -2400,7 +2400,7 @@ void LSRInstance::GenerateConstantOffsets(LSRUse &LU, unsigned LUIdx, if (isLegalUse(F.AM, LU.MinOffset - *I, LU.MaxOffset - *I, LU.Kind, LU.AccessTy, TLI)) { // Add the offset to the base register. - const SCEV *NewG = SE.getAddExpr(G, SE.getConstant(G->getType(), *I)); + const SCEV *NewG = SE.getAddExpr(SE.getConstant(G->getType(), *I), G); // If it cancelled out, drop the base register, otherwise update it. if (NewG->isZero()) { std::swap(F.BaseRegs[i], F.BaseRegs.back()); |

