summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-08-27 21:34:31 +0000
committerDevang Patel <dpatel@apple.com>2007-08-27 21:34:31 +0000
commitd2456a171d98f3b8b1ad1bef1da03622cdd55df2 (patch)
treea730f1840f386c4ae1607fc5b47dc51be4482e5c /llvm/lib
parente31313d792b516de9690a9724689a364273e89f4 (diff)
downloadbcm5719-llvm-d2456a171d98f3b8b1ad1bef1da03622cdd55df2.tar.gz
bcm5719-llvm-d2456a171d98f3b8b1ad1bef1da03622cdd55df2.zip
Use simpler test to filter loops.
llvm-svn: 41516
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
index d6463f3525b..4a6202e7836 100644
--- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -752,21 +752,10 @@ bool LoopIndexSplit::safeSplitCondition(SplitInfo &SD) {
&& (Latch == Succ0 || Latch == Succ1))
return false;
- // If one of the split condition branch is post dominating other then loop
- // index split is not appropriate.
- if (DT->dominates(Succ0, Latch) || DT->dominates(Succ1, Latch))
+ // If split condition branches heads do not have single predecessor,
+ // SplitCondBlock, then is not possible to remove inactive branch.
+ if (!Succ0->getSinglePredecessor() || !Succ1->getSinglePredecessor())
return false;
-
- // If one of the split condition branch is a predecessor of the other
- // split condition branch head then do not split loop on this condition.
- for(pred_iterator PI = pred_begin(Succ0), PE = pred_end(Succ0);
- PI != PE; ++PI)
- if (Succ1 == *PI)
- return false;
- for(pred_iterator PI = pred_begin(Succ1), PE = pred_end(Succ1);
- PI != PE; ++PI)
- if (Succ0 == *PI)
- return false;
// Finally this split condition is safe only if merge point for
// split condition branch is loop latch. This check along with previous
OpenPOWER on IntegriCloud