1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Revert r133004 ; it's breaking nightly tests.

llvm-svn: 133007
This commit is contained in:
Eli Friedman 2011-06-14 19:30:33 +00:00
parent 53ce31b37e
commit fadc05bee8

View File

@ -1925,7 +1925,7 @@ isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const {
return false;
// The predecessor has to be immediately before this block.
const MachineBasicBlock *Pred = *PI;
MachineBasicBlock *Pred = *PI;
if (!Pred->isLayoutSuccessor(MBB))
return false;
@ -1934,9 +1934,26 @@ isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const {
if (Pred->empty())
return true;
// Otherwise, check the last instruction.
const MachineInstr &LastInst = Pred->back();
return !LastInst.getDesc().isBarrier();
// Check the terminators in the previous blocks
for (MachineBasicBlock::iterator II = Pred->getFirstTerminator(),
IE = Pred->end(); II != IE; ++II) {
MachineInstr &MI = *II;
// If it is not a simple branch, we are in a table somewhere.
if (!MI.getDesc().isBranch() || MI.getDesc().isIndirectBranch())
return false;
// If we are the operands of one of the branches, this is not
// a fall through.
for (MachineInstr::mop_iterator OI = MI.operands_begin(),
OE = MI.operands_end(); OI != OE; ++OI) {
const MachineOperand& OP = *OI;
if (OP.isMBB() && OP.getMBB() == MBB)
return false;
}
}
return true;
}