From 23c3fde39aa35334e74c26273a8973a872871e34 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 7 Oct 2010 23:41:58 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 4298b1c2e38..b292ffec887 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -728,6 +728,9 @@ void Cost::RateRegister(const SCEV *Reg, (isa(cast(Reg)->getStart()) || isa(cast(Reg)->getStart())))) ++SetupCost; + + NumIVMuls += isa(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(BaseReg) && - BaseReg->hasComputableLoopEvolution(L); } if (F.BaseRegs.size() > 1) -- 2.34.1