mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-02 02:14:23 +00:00
Handle blocks with 2 unconditional branches in AnalyzeBranch.
llvm-svn: 37571
This commit is contained in:
parent
51e6294637
commit
7e3253f115
@ -345,6 +345,16 @@ bool ARMInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the block ends with two B's or tB's, handle it. The second one is not
|
||||
// executed, so remove it.
|
||||
if ((SecondLastOpc == ARM::B || SecondLastOpc==ARM::tB) &&
|
||||
(LastOpc == ARM::B || LastOpc == ARM::tB)) {
|
||||
TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
|
||||
I = LastInst;
|
||||
I->eraseFromParent();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, can't handle this.
|
||||
return true;
|
||||
}
|
||||
|
@ -200,6 +200,16 @@ bool AlphaInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TB
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the block ends with two Alpha::BRs, handle it. The second one is not
|
||||
// executed, so remove it.
|
||||
if (SecondLastInst->getOpcode() == Alpha::BR &&
|
||||
LastInst->getOpcode() == Alpha::BR) {
|
||||
TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
|
||||
I = LastInst;
|
||||
I->eraseFromParent();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, can't handle this.
|
||||
return true;
|
||||
}
|
||||
|
@ -220,6 +220,16 @@ bool PPCInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the block ends with two PPC:Bs, handle it. The second one is not
|
||||
// executed, so remove it.
|
||||
if (SecondLastInst->getOpcode() == PPC::B &&
|
||||
LastInst->getOpcode() == PPC::B) {
|
||||
TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
|
||||
I = LastInst;
|
||||
I->eraseFromParent();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, can't handle this.
|
||||
return true;
|
||||
}
|
||||
|
@ -427,6 +427,16 @@ bool X86InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the block ends with two X86::JMPs, handle it. The second one is not
|
||||
// executed, so remove it.
|
||||
if (SecondLastInst->getOpcode() == X86::JMP &&
|
||||
LastInst->getOpcode() == X86::JMP) {
|
||||
TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
|
||||
I = LastInst;
|
||||
I->eraseFromParent();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, can't handle this.
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user