summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2016-11-15 19:42:05 +0000
committerWei Mi <wmi@google.com>2016-11-15 19:42:05 +0000
commit37c4aaaf5260973940c580ad9d05f33de416be64 (patch)
treeca84cb07effc2148c37a34d17214af736d5967fd /llvm/lib/Transforms
parent92b355b1a941e4dac540ff2e81d5a16783903c30 (diff)
downloadbcm5719-llvm-37c4aaaf5260973940c580ad9d05f33de416be64.tar.gz
bcm5719-llvm-37c4aaaf5260973940c580ad9d05f33de416be64.zip
Revert r286999 which caused buildbot test failures. Some testcases need to be made target specific.
llvm-svn: 287014
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index f22e8a69bdb..75677079e37 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1048,16 +1048,17 @@ void Cost::RateRegister(const SCEV *Reg,
const Loop *L,
ScalarEvolution &SE, DominatorTree &DT) {
if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(Reg)) {
- // If this is an addrec for another loop, it should be an invariant
- // with respect to L since L is the innermost loop (at least
- // for now LSR only handles innermost loops).
+ // If this is an addrec for another loop, don't second-guess its addrec phi
+ // nodes. LSR isn't currently smart enough to reason about more than one
+ // loop at a time. LSR has already run on inner loops, will not run on outer
+ // loops, and cannot be expected to change sibling loops.
if (AR->getLoop() != L) {
// If the AddRec exists, consider it's register free and leave it alone.
if (isExistingPhi(AR, SE))
return;
- // Otherwise, it will be an invariant with respect to Loop L.
- ++NumRegs;
+ // Otherwise, do not consider this formula at all.
+ Lose();
return;
}
AddRecCost += 1; /// TODO: This should be a function of the stride.
OpenPOWER on IntegriCloud