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 | 317941369bf8937082b0d54d35e4d6f00d428902 (patch) | |
| tree | 1ba457be22e3f867d27b548a220a0d161e8e735b /lib/Transforms | |
| parent | 62175780ba2eb090cd145f23465b0cb0f3993bad (diff) | |
| download | external_llvm-317941369bf8937082b0d54d35e4d6f00d428902.zip external_llvm-317941369bf8937082b0d54d35e4d6f00d428902.tar.gz external_llvm-317941369bf8937082b0d54d35e4d6f00d428902.tar.bz2 | |
Put add operands in ScalarEvolution-canonical order, when convenient.
This isn't necessary, because ScalarEvolution sorts them anyway,
but it's tidier this way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index a040e8a..95e25dd 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/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()); |
