Changes in directory llvm/lib/Transforms/Scalar:

LoopUnswitch.cpp updated: 1.42 -> 1.43
---
Log message:

Don't unswitch really large loops even if they are mostly filled with empty
blocks.



---
Diffs of the changes:  (+6 -0)

 LoopUnswitch.cpp |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.42 
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.43
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.42    Tue Jun 27 17:26:09 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Wed Jun 28 11:38:55 2006
@@ -333,6 +333,12 @@
   if (IsTrivialUnswitchCondition(L, LIC))
     return 0;
   
+  // If the loop is really large (over twice our threshold) don't even consider
+  // unswitching it.  This will produce a really large loop with lots of empty
+  // blocks.
+  if (L->getBlocks().size() > 2*Threshold)
+    return 2*Threshold;
+  
   unsigned Cost = 0;
   // FIXME: this is brain dead.  It should take into consideration code
   // shrinkage.



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to