diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-12-13 19:55:30 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-12-13 19:55:30 +0000 | 
| commit | 2d434e594ef9f06b3b21ccee1ddee83a2183a9d1 (patch) | |
| tree | 23b3a06f5b93c2fd33cfc1606c2bc1bb7e89d648 | |
| parent | 578074b2f3b5eedc7e3f391bb717ada05a1dde65 (diff) | |
| download | bcm5719-llvm-2d434e594ef9f06b3b21ccee1ddee83a2183a9d1.tar.gz bcm5719-llvm-2d434e594ef9f06b3b21ccee1ddee83a2183a9d1.zip  | |
add some DEBUG's.
llvm-svn: 121711
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 11 | 
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 9ca1079ab31..12960c94645 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1905,10 +1905,16 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) {    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 @@ bool SimplifyCFGOpt::SimplifyCondBranch(BranchInst *BI) {    // 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 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) {      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;  | 

