]> granicus.if.org Git - llvm/commitdiff
GlobalISel: the translation of an invoke must branch to the good block.
authorTim Northover <tnorthover@apple.com>
Tue, 31 Jan 2017 20:12:18 +0000 (20:12 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 31 Jan 2017 20:12:18 +0000 (20:12 +0000)
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

lib/CodeGen/GlobalISel/IRTranslator.cpp
test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll

index 51613ab81f62d88c3dbbac9d9148d9b467e7af50..d8dc6a37a528116f2359de8d8e10b98819533de2 100644 (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;
 }
index 9cb3923fd2ad7c42f88e4cf184cc73e8f93927b4..5469c6c56343b99133ff366add247574cf145abb 100644 (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