mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
a150110be1
SimplifyCFG should not merge empty return blocks and leave a CallBr behind with a duplicated destination since the verifier will then trigger an assert. This patch checks for this case and avoids the transformation. CodeGenPrepare has a similar check which also has a FIXME comment about why this is needed. It seems perhaps better if these two passes would eventually instead update the CallBr instruction instead of just checking and avoiding. This fixes https://bugs.llvm.org/show_bug.cgi?id=45062. Review: Craig Topper Differential Revision: https://reviews.llvm.org/D75620
29 lines
757 B
LLVM
29 lines
757 B
LLVM
; RUN: opt < %s -simplifycfg -disable-output
|
|
;
|
|
; Test that SimplifyCFG does not cause CallBr instructions to have duplicate
|
|
; destinations, which will cause the verifier to assert.
|
|
|
|
define void @fun0() {
|
|
entry:
|
|
callbr void asm sideeffect "", "X"(i8* blockaddress(@fun0, %bb1))
|
|
to label %bb2 [label %bb1]
|
|
|
|
bb1: ; preds = %bb
|
|
ret void
|
|
|
|
bb2: ; preds = %bb
|
|
ret void
|
|
}
|
|
|
|
define void @fun1() {
|
|
entry:
|
|
callbr void asm sideeffect "", "X"(i8* blockaddress(@fun1, %bb1))
|
|
to label %bb2 [label %bb1]
|
|
|
|
bb2: ; preds = %bb
|
|
ret void
|
|
|
|
bb1: ; preds = %bb
|
|
ret void
|
|
}
|