forked from OSchip/llvm-project
[SystemZ] Recognize INLINEASM_BR in backend.
SystemZInstrInfo::analyzeBranch() needs to check for INLINEASM_BR instructions, or it will crash. Review: Ulrich Weigand llvm-svn: 370753
This commit is contained in:
parent
600f5c5727
commit
a0a811739d
|
@ -462,8 +462,8 @@ bool SystemZInstrInfo::analyzeBranch(MachineBasicBlock &MBB,
|
|||
break;
|
||||
|
||||
// A terminator that isn't a branch can't easily be handled by this
|
||||
// analysis.
|
||||
if (!I->isBranch())
|
||||
// analysis. Asm goto is not understood / optimized.
|
||||
if (!I->isBranch() || I->getOpcode() == SystemZ::INLINEASM_BR)
|
||||
return true;
|
||||
|
||||
// Can't handle indirect branches.
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
; Test that asm goto can be compiled.
|
||||
;
|
||||
; RUN: llc < %s -mtriple=s390x-linux-gnu
|
||||
|
||||
define i32 @c() {
|
||||
entry:
|
||||
callbr void asm sideeffect "", "X"(i8* blockaddress(@c, %d))
|
||||
to label %asm.fallthrough [label %d]
|
||||
|
||||
asm.fallthrough: ; preds = %entry
|
||||
br label %d
|
||||
|
||||
d: ; preds = %asm.fallthrough, %entry
|
||||
ret i32 undef
|
||||
}
|
Loading…
Reference in New Issue