mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-28 07:05:03 +00:00
Be more layout aware here and swap the successor and branch condition
if it means we get a fallthrough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4756ecb375
commit
7a20a37bac
@ -1132,9 +1132,16 @@ bool ARMFastISel::SelectBranch(const Instruction *I) {
|
||||
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TstOpc))
|
||||
.addReg(CmpReg).addImm(1));
|
||||
|
||||
|
||||
unsigned CCMode = ARMCC::NE;
|
||||
if (FuncInfo.MBB->isLayoutSuccessor(TBB)) {
|
||||
std::swap(TBB, FBB);
|
||||
CCMode = ARMCC::EQ;
|
||||
}
|
||||
|
||||
unsigned BrOpc = isThumb ? ARM::t2Bcc : ARM::Bcc;
|
||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(BrOpc))
|
||||
.addMBB(TBB).addImm(ARMCC::NE).addReg(ARM::CPSR);
|
||||
.addMBB(TBB).addImm(CCMode).addReg(ARM::CPSR);
|
||||
FastEmitBranch(FBB, DL);
|
||||
FuncInfo.MBB->addSuccessor(TBB);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user