|
3 | 3 |
|
4 | 4 | ; Test `%r` can be replaced by `%nonpoison`. |
5 | 5 |
|
6 | | -define i32 @other_noundef() { |
7 | | -; CHECK-LABEL: define i32 @other_noundef() { |
| 6 | +define i32 @other_noundef(i32 noundef %arg) { |
| 7 | +; CHECK-LABEL: define i32 @other_noundef( |
| 8 | +; CHECK-SAME: i32 noundef [[ARG:%.*]]) { |
8 | 9 | ; CHECK-NEXT: [[START:.*]]: |
9 | 10 | ; CHECK-NEXT: br label %[[LOOP:.*]] |
10 | 11 | ; CHECK: [[LOOP]]: |
11 | | -; CHECK-NEXT: [[NONPOISON:%.*]] = phi i32 [ 0, %[[START]] ], [ [[NONPOISON]], %[[BB0:.*]] ], [ 1, %[[BB1:.*]] ] |
| 12 | +; CHECK-NEXT: [[NONPOISON:%.*]] = phi i32 [ 0, %[[START]] ], [ [[NONPOISON]], %[[BB0:.*]] ], [ [[ARG]], %[[BB1:.*]] ] |
12 | 13 | ; CHECK-NEXT: [[I:%.*]] = call i32 @opaque() |
13 | 14 | ; CHECK-NEXT: switch i32 [[I]], label %[[EXIT:.*]] [ |
14 | 15 | ; CHECK-NEXT: i32 0, label %[[BB0]] |
|
25 | 26 | br label %loop |
26 | 27 |
|
27 | 28 | loop: |
28 | | - %nonpoison = phi i32 [ 0, %start ], [ %nonpoison, %bb0 ], [ 1, %bb1 ] |
| 29 | + %nonpoison = phi i32 [ 0, %start ], [ %nonpoison, %bb0 ], [ %arg, %bb1 ] |
29 | 30 | %i = call i32 @opaque() |
30 | 31 | switch i32 %i, label %exit [ |
31 | 32 | i32 0, label %bb0 |
|
43 | 44 | br label %loop |
44 | 45 | } |
45 | 46 |
|
46 | | -define i32 @other_poison() { |
47 | | -; CHECK-LABEL: define i32 @other_poison() { |
48 | | -; CHECK-NEXT: [[START:.*:]] |
| 47 | +define i32 @other_poison(i32 %arg) { |
| 48 | +; CHECK-LABEL: define i32 @other_poison( |
| 49 | +; CHECK-SAME: i32 [[ARG:%.*]]) { |
| 50 | +; CHECK-NEXT: [[START:.*]]: |
49 | 51 | ; CHECK-NEXT: br label %[[LOOP:.*]] |
50 | 52 | ; CHECK: [[LOOP]]: |
| 53 | +; CHECK-NEXT: [[MAYPOISON:%.*]] = phi i32 [ 0, %[[START]] ], [ [[MAYPOISON]], %[[BB0:.*]] ], [ [[ARG]], %[[BB1:.*]] ] |
51 | 54 | ; CHECK-NEXT: [[I:%.*]] = call i32 @opaque() |
52 | 55 | ; CHECK-NEXT: switch i32 [[I]], label %[[EXIT:.*]] [ |
53 | | -; CHECK-NEXT: i32 0, label %[[BB0:.*]] |
54 | | -; CHECK-NEXT: i32 1, label %[[BB1:.*]] |
| 56 | +; CHECK-NEXT: i32 0, label %[[BB0]] |
| 57 | +; CHECK-NEXT: i32 1, label %[[BB1]] |
55 | 58 | ; CHECK-NEXT: ] |
56 | 59 | ; CHECK: [[EXIT]]: |
57 | | -; CHECK-NEXT: ret i32 0 |
| 60 | +; CHECK-NEXT: [[R:%.*]] = freeze i32 [[MAYPOISON]] |
| 61 | +; CHECK-NEXT: ret i32 [[R]] |
58 | 62 | ; CHECK: [[BB0]]: |
59 | 63 | ; CHECK-NEXT: br label %[[LOOP]] |
60 | 64 | ; CHECK: [[BB1]]: |
|
64 | 68 | br label %loop |
65 | 69 |
|
66 | 70 | loop: |
67 | | - %maypoison = phi i32 [ 0, %start ], [ %maypoison, %bb0 ], [ poison, %bb1 ] |
| 71 | + %maypoison = phi i32 [ 0, %start ], [ %maypoison, %bb0 ], [ %arg, %bb1 ] |
68 | 72 | %i = call i32 @opaque() |
69 | 73 | switch i32 %i, label %exit [ |
70 | 74 | i32 0, label %bb0 |
|
0 commit comments