removed-use.ll
946 Bytes
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
; RUN: opt -S < %s -jump-threading | FileCheck %s
; CHECK-LABEL: @foo
; CHECK: bb6:
; CHECK-NEXT: ret void
; CHECK: bb3:
; CHECK: br label %bb3
define void @foo() {
entry:
br i1 true, label %bb6, label %bb3
bb3:
%x0 = phi i32 [ undef, %entry ], [ %x1, %bb5 ]
%y = and i64 undef, 1
%p = icmp ne i64 %y, 0
br i1 %p, label %bb4, label %bb5
bb4:
br label %bb5
bb5:
%x1 = phi i32 [ %x0, %bb3 ], [ %x0, %bb4 ]
%z = phi i32 [ 0, %bb3 ], [ 1, %bb4 ]
%q = icmp eq i32 %z, 0
br i1 %q, label %bb3, label %bb6
bb6:
ret void
}
; CHECK-LABEL: @bar
; Just check that we don't crash on this test.
define void @bar(i1 %p) {
entry:
br i1 false, label %bb2, label %exit
bb2:
%x0 = phi i32 [ undef, %entry ], [ %x1, %bb5 ]
br i1 %p, label %bb3, label %bb4
bb3:
br label %bb5
bb4:
br label %bb5
bb5:
%x1 = phi i32 [ %x0, %bb3 ], [ 0, %bb4 ]
switch i32 %x1, label %exit [
i32 10, label %bb2
]
exit:
ret void
}