summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-09-26 23:35:25 +0000
committerAndrew Trick <atrick@apple.com>2011-09-26 23:35:25 +0000
commit25b689e067697d3b49ae123120703fada030350f (patch)
treef539bba4009c30250d4690ee44c1fc853f1734e7 /lib
parent184944acdfb74041a2362af904e6eda3f0d3f645 (diff)
downloadllvm-25b689e067697d3b49ae123120703fada030350f.tar.gz
llvm-25b689e067697d3b49ae123120703fada030350f.tar.bz2
llvm-25b689e067697d3b49ae123120703fada030350f.tar.xz
LSR, one of the new Cost::isLoser() checks did not get merged in the previous checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 1e5b56bc4e..0ad9fc3841 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -745,9 +745,13 @@ void Cost::RateRegister(const SCEV *Reg,
// Add the step value register, if it needs one.
// TODO: The non-affine case isn't precisely modeled here.
- if (!AR->isAffine() || !isa<SCEVConstant>(AR->getOperand(1)))
- if (!Regs.count(AR->getOperand(1)))
+ if (!AR->isAffine() || !isa<SCEVConstant>(AR->getOperand(1))) {
+ if (!Regs.count(AR->getOperand(1))) {
RateRegister(AR->getOperand(1), Regs, L, SE, DT);
+ if (isLoser())
+ return;
+ }
+ }
}
++NumRegs;