[llvm-commits] CVS: llvm/lib/CodeGen/IfConversion.cpp

Evan Cheng evan.cheng at apple.com
Tue Jun 19 14:45:36 PDT 2007



Changes in directory llvm/lib/CodeGen:

IfConversion.cpp updated: 1.58 -> 1.59
---
Log message:

Avoid if-converting simple block that ends with unconditional branch or fallthrough unless it branches / falls to the 'false' block. Not profitable, may end up increasing code size.

---
Diffs of the changes:  (+4 -1)

 IfConversion.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/IfConversion.cpp
diff -u llvm/lib/CodeGen/IfConversion.cpp:1.58 llvm/lib/CodeGen/IfConversion.cpp:1.59
--- llvm/lib/CodeGen/IfConversion.cpp:1.58	Mon Jun 18 20:26:12 2007
+++ llvm/lib/CodeGen/IfConversion.cpp	Tue Jun 19 16:45:13 2007
@@ -399,6 +399,9 @@
   if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone)
     return false;
 
+  if (TrueBBI.IsBrAnalyzable)
+    return false;
+
   if (TrueBBI.BB->pred_size() > 1) {
     if (TrueBBI.CannotBeCopied ||
         TrueBBI.NonPredSize > TLI->getIfCvtDupBlockSizeLimit())
@@ -406,7 +409,7 @@
     Dups = TrueBBI.NonPredSize;
   }
 
-  return !blockAlwaysFallThrough(TrueBBI) && TrueBBI.BrCond.size() == 0;
+  return true;
 }
 
 /// ValidTriangle - Returns true if the 'true' and 'false' blocks (along






More information about the llvm-commits mailing list