summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-27 22:58:27 +0000
committerDan Gohman <gohman@apple.com>2009-06-27 22:58:27 +0000
commit317f054531c9f09c08825f5db0b522532d1595af (patch)
tree7e13908efe58c3e557c8ff47792c63049682e4d6 /llvm/lib/Transforms
parentffdcba3dbdc3d87ef95e309fc158ee08c0edd0ed (diff)
downloadbcm5719-llvm-317f054531c9f09c08825f5db0b522532d1595af.tar.gz
bcm5719-llvm-317f054531c9f09c08825f5db0b522532d1595af.zip
Don't try to split a loop when the controlling icmp instruction
doesn't have an IV-based operand. This fixes PR4471. llvm-svn: 74399
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
index 6f7a7f866a8..ff0ec6d2ac6 100644
--- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -258,6 +258,9 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) {
IVExitValue = ExitCondition->getOperand(0);
if (!L->isLoopInvariant(IVExitValue))
return false;
+ if (!IVBasedValues.count(
+ ExitCondition->getOperand(IVExitValue == ExitCondition->getOperand(0))))
+ return false;
// If start value is more then exit value where induction variable
// increments by 1 then we are potentially dealing with an infinite loop.
OpenPOWER on IntegriCloud