for (MachineFunction::iterator I = std::next(MF.begin()), E = MF.end();
I != E; ) {
MachineBasicBlock *MBB = &*I++;
+ // XXX-disabled: Don't optimize blocks that contain intentionally added fake
+ // conditional branch.
+ if (!MBB->getCanEliminateMachineBB()) {
+ continue;
+ }
+
MadeChange |= OptimizeBlock(MBB);
// If it is dead, remove it.
goto ReoptimizeBlock;
}
- /*
// If the previous block unconditionally falls through to this block and
// this block has no other predecessors, move the contents of this block
// into the prior block. This doesn't usually happen when SimplifyCFG
MadeChange = true;
return MadeChange;
}
- */
// If the previous branch *only* branches to *this* block (conditional or
// not) remove the branch.
if (PriorTBB == MBB && !PriorFBB) {
- // XXX-disabled: Don't fold conditional branches that we added
- // intentionally.
- MachineBasicBlock::iterator I = PrevBB.getLastNonDebugInstr();
- if (I != PrevBB.end()) {
- if (I->isConditionalBranch()) {
- return MadeChange ;
- }
- }
-
TII->RemoveBranch(PrevBB);
MadeChange = true;
++NumBranchOpts;