mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
add some DEBUG's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1905,10 +1905,16 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) {
|
|||||||
|
|
||||||
BasicBlock *BB = BI->getParent();
|
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
|
// 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
|
// then we evaluate them with an explicit branch first. Split the block
|
||||||
// right before the condbr to handle it.
|
// right before the condbr to handle it.
|
||||||
if (ExtraCase) {
|
if (ExtraCase) {
|
||||||
|
DEBUG(dbgs() << " ** 'icmp' chain unhandled condition: " << *ExtraCase
|
||||||
|
<< '\n');
|
||||||
|
|
||||||
BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test");
|
BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test");
|
||||||
// Remove the uncond branch added to the old block.
|
// Remove the uncond branch added to the old block.
|
||||||
TerminatorInst *OldTI = BB->getTerminator();
|
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
|
// branches to us and one of our successors, fold the setcc into the
|
||||||
// predecessor and use logical operations to pick the right destination.
|
// predecessor and use logical operations to pick the right destination.
|
||||||
if (FoldBranchToCommonDest(BI))
|
if (FoldBranchToCommonDest(BI))
|
||||||
return SimplifyCFG(BB) | true;
|
return true;
|
||||||
|
|
||||||
// Scan predecessor blocks for conditional branches.
|
// Scan predecessor blocks for conditional branches.
|
||||||
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
|
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 (BI->isUnconditional()) {
|
||||||
if (SimplifyUncondBranch(BI)) return true;
|
if (SimplifyUncondBranch(BI)) return true;
|
||||||
} else {
|
} else {
|
||||||
if (SimplifyCondBranch(BI))
|
if (SimplifyCondBranch(BI)) return true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} else if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
|
} else if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
|
||||||
if (SimplifyReturn(RI)) return true;
|
if (SimplifyReturn(RI)) return true;
|
||||||
|
Reference in New Issue
Block a user