phi-in-dead-block.ll
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; RUN: opt -S -lowerswitch %s | FileCheck %s
; CHECK-LABEL: @phi_in_dead_block(
; CHECK-NOT: switch
define void @phi_in_dead_block() {
bb:
br i1 undef, label %bb2, label %bb3
bb1: ; No predecessors!
switch i32 undef, label %bb2 [
i32 9, label %bb3
]
bb2: ; preds = %bb1, %bb
%tmp = phi i64 [ undef, %bb1 ], [ undef, %bb ]
unreachable
bb3: ; preds = %bb1, %bb
unreachable
}
; CHECK-LABEL: @phi_in_dead_block_br_to_self(
; CHECK-NOT: switch
define void @phi_in_dead_block_br_to_self() {
bb:
br i1 undef, label %bb2, label %bb3
bb1: ; No predecessors!
switch i32 undef, label %bb2 [
i32 9, label %bb3
i32 10, label %bb1
]
bb2: ; preds = %bb1, %bb
%tmp = phi i64 [ undef, %bb1 ], [ undef, %bb ]
unreachable
bb3: ; preds = %bb1, %bb
unreachable
}