[llvm-commits] [llvm] r121711 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Chris Lattner sabre at nondot.org
Mon Dec 13 11:55:30 PST 2010


Author: lattner
Date: Mon Dec 13 13:55:30 2010
New Revision: 121711

URL: http://llvm.org/viewvc/llvm-project?rev=121711&view=rev
Log:
add some DEBUG's.

Modified:
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=121711&r1=121710&r2=121711&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Mon Dec 13 13:55:30 2010
@@ -1905,10 +1905,16 @@
   
   BasicBlock *BB = BI->getParent();
   
+  DEBUG(dbgs() << "CONVERTING 'icmp' CHAIN with " << Values.size()
+               << " cases into SWITCH.  BB is:\n" << *BB);
+  
   // If there are any extra values that couldn't be folded into the switch
   // then we evaluate them with an explicit branch first.  Split the block
   // right before the condbr to handle it.
   if (ExtraCase) {
+    DEBUG(dbgs() << "  ** 'icmp' chain unhandled condition: " << *ExtraCase
+                 << '\n');
+    
     BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test");
     // Remove the uncond branch added to the old block.
     TerminatorInst *OldTI = BB->getTerminator();
@@ -2361,7 +2367,7 @@
   // branches to us and one of our successors, fold the setcc into the
   // predecessor and use logical operations to pick the right destination.
   if (FoldBranchToCommonDest(BI))
-    return SimplifyCFG(BB) | true;
+    return true;
   
   // Scan predecessor blocks for conditional branches.
   for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
@@ -2413,8 +2419,7 @@
     if (BI->isUnconditional()) {
       if (SimplifyUncondBranch(BI)) return true;
     } else {
-      if (SimplifyCondBranch(BI))
-        return true;
+      if (SimplifyCondBranch(BI)) return true;
     }
   } else if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
     if (SimplifyReturn(RI)) return true;





More information about the llvm-commits mailing list