GlobalISel: the translation of an invoke must branch to the good block.

Otherwise bad things happen if the basic block order isn't trivial after an
invoke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover 2017-01-31 20:12:18 +00:00
parent becaf19d2d
commit 3b21070320
2 changed files with 2 additions and 0 deletions

View File

@ -749,6 +749,7 @@ bool IRTranslator::translateInvoke(const User &U,
MF->addInvoke(&EHPadMBB, BeginSymbol, EndSymbol);
MIRBuilder.getMBB().addSuccessor(&ReturnMBB);
MIRBuilder.getMBB().addSuccessor(&EHPadMBB);
MIRBuilder.buildBr(ReturnMBB);
return true;
}

View File

@ -15,6 +15,7 @@ declare i32 @llvm.eh.typeid.for(i8*)
; CHECK: BL @foo, csr_aarch64_aapcs, implicit-def %lr, implicit %sp, implicit %w0, implicit-def %w0
; CHECK: {{%[0-9]+}}(s32) = COPY %w0
; CHECK: EH_LABEL
; CHECK: G_BR %[[GOOD]]
; CHECK: [[BAD]] (landing-pad):
; CHECK: EH_LABEL