diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-07 23:41:58 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-07 23:41:58 +0000 |
commit | 23c3fde39aa35334e74c26273a8973a872871e34 (patch) | |
tree | 1c882a55f811ee37295f88c7d18813bb963aa2c9 /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | 0d6715a413a23c021d1042719888966bb8d11872 (diff) |
Charge a formula for explicit multiplies on scaled registers too,
not just base registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 4298b1c2e3..b292ffec88 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -728,6 +728,9 @@ void Cost::RateRegister(const SCEV *Reg, (isa<SCEVUnknown>(cast<SCEVAddRecExpr>(Reg)->getStart()) || isa<SCEVConstant>(cast<SCEVAddRecExpr>(Reg)->getStart())))) ++SetupCost; + + NumIVMuls += isa<SCEVMulExpr>(Reg) && + Reg->hasComputableLoopEvolution(L); } /// RatePrimaryRegister - Record this register in the set. If we haven't seen it @@ -762,9 +765,6 @@ void Cost::RateFormula(const Formula &F, return; } RatePrimaryRegister(BaseReg, Regs, L, SE, DT); - - NumIVMuls += isa<SCEVMulExpr>(BaseReg) && - BaseReg->hasComputableLoopEvolution(L); } if (F.BaseRegs.size() > 1) |