summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-14 03:21:49 +0000
committerDan Gohman <gohman@apple.com>2010-02-14 03:21:49 +0000
commit2d0f96d49ada02769a18b65756ef292d1618ab2d (patch)
treee8f650ab15bc97f07146903c363b4dc5169e2449 /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent6b7517342e5f9eee8edf28abf7db7be35e7c8f39 (diff)
downloadbcm5719-llvm-2d0f96d49ada02769a18b65756ef292d1618ab2d.tar.gz
bcm5719-llvm-2d0f96d49ada02769a18b65756ef292d1618ab2d.zip
Actually, this code doesn't have to be quite so conservative in
the no-TLI case. But it should still default to declining the transformation. llvm-svn: 96152
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 0c65e33c61d..b6ef718ce16 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1503,11 +1503,7 @@ LSRInstance::OptimizeLoopTermCond() {
// Conservatively avoid trying to use the post-inc value in non-latch
// exits if there may be pre-inc users in intervening blocks.
- if (LatchBlock != ExitingBlock) {
- // Without target lowering, we won't be able to query about valid reuse.
- if (!TLI)
- continue;
-
+ if (LatchBlock != ExitingBlock)
for (IVUsers::const_iterator UI = IU.begin(), E = IU.end(); UI != E; ++UI)
// Test if the use is reachable from the exiting block. This dominator
// query is a conservative approximation of reachability.
@@ -1535,6 +1531,10 @@ LSRInstance::OptimizeLoopTermCond() {
if (D->getValue()->getValue().getMinSignedBits() >= 64 ||
D->getValue()->getValue().isMinSignedValue())
goto decline_post_inc;
+ // Without TLI, assume that any stride might be valid, and so any
+ // use might be shared.
+ if (!TLI)
+ goto decline_post_inc;
// Check for possible scaled-address reuse.
const Type *AccessTy = getAccessType(UI->getUser());
TargetLowering::AddrMode AM;
@@ -1546,7 +1546,6 @@ LSRInstance::OptimizeLoopTermCond() {
goto decline_post_inc;
}
}
- }
DEBUG(dbgs() << " Change loop exiting icmp to use postinc iv: "
<< *Cond << '\n');
OpenPOWER on IntegriCloud