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