[llvm-commits] [llvm] r41516 - /llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp

Devang Patel dpatel at apple.com
Mon Aug 27 14:34:31 PDT 2007


Author: dpatel
Date: Mon Aug 27 16:34:31 2007
New Revision: 41516

URL: http://llvm.org/viewvc/llvm-project?rev=41516&view=rev
Log:
Use simpler test to filter loops.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=41516&r1=41515&r2=41516&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Aug 27 16:34:31 2007
@@ -752,21 +752,10 @@
       && (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





More information about the llvm-commits mailing list