[llvm] r293679 - GlobalISel: the translation of an invoke must branch to the good block.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 12:12:19 PST 2017
Author: tnorthover
Date: Tue Jan 31 14:12:18 2017
New Revision: 293679
URL: http://llvm.org/viewvc/llvm-project?rev=293679&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=293679&r1=293678&r2=293679&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Tue Jan 31 14:12:18 2017
@@ -749,6 +749,7 @@ bool IRTranslator::translateInvoke(const
MF->addInvoke(&EHPadMBB, BeginSymbol, EndSymbol);
MIRBuilder.getMBB().addSuccessor(&ReturnMBB);
MIRBuilder.getMBB().addSuccessor(&EHPadMBB);
+ MIRBuilder.buildBr(ReturnMBB);
return true;
}
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll?rev=293679&r1=293678&r2=293679&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll Tue Jan 31 14:12:18 2017
@@ -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
More information about the llvm-commits
mailing list