ordering.ll
2.15 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
; REQUIRES: assert
; RUN: opt -print-predicateinfo -analyze -debug < %s 2>&1 | FileCheck %s
declare void @use(i32)
; Make sure we are visiting the values to build predicate infos for in a
; deterministic order.
define i32 @test12(i32 %x, i32 %y) {
; CHECK: Visiting i32 %x
; CHECK: Visiting i32 %y
; CHECK: Visiting %lcmp = icmp eq i32 %x, 0
; CHECK: Visiting %lcmp2 = icmp slt i32 %y, 1000
; CHECK: Visiting %lcmp3 = icmp slt i32 %y.0, 900
; CHECK: Visiting %lcmp4 = icmp slt i32 %y.0.1, 700
; CHECK: Visiting %lcmp5 = icmp slt i32 %y.0.1.2, 700
; CHECK: Visiting %lcmp6 = icmp slt i32 %y.0.1.2.3, 700
; CHECK: Visiting %lcmp7 = icmp slt i32 %y.0.1.2.3.4, 700
; CHECK: Visiting %rcmp = icmp eq i32 %x, 0
entry:
br i1 undef, label %left, label %right
left:
%lcmp = icmp eq i32 %x, 0
br i1 %lcmp, label %left_cond_true, label %left_cond_false
left_cond_true:
%lcmp2 = icmp slt i32 %y, 1000
br i1 %lcmp2, label %left_cond_true2, label %left_ret
left_cond_true2:
call void @use(i32 %y)
%lcmp3 = icmp slt i32 %y, 900
br i1 %lcmp3, label %left_cond_true3, label %left_ret
left_cond_true3:
call void @use(i32 %y)
%lcmp4 = icmp slt i32 %y, 700
br i1 %lcmp4, label %left_cond_true4, label %left_ret
left_cond_true4:
call void @use(i32 %y)
%lcmp5 = icmp slt i32 %y, 700
br i1 %lcmp5, label %left_cond_true5, label %left_ret
left_cond_true5:
call void @use(i32 %y)
%lcmp6 = icmp slt i32 %y, 700
br i1 %lcmp6, label %left_cond_true6, label %left_ret
left_cond_true6:
call void @use(i32 %y)
%lcmp7 = icmp slt i32 %y, 700
br i1 %lcmp7, label %left_cond_true7, label %left_ret
left_cond_true7:
ret i32 %y
left_cond_false:
br label %left_ret
left_ret:
%lres = phi i32 [ %x, %left_cond_true ], [ %x, %left_cond_false ], [ %x, %left_cond_true2 ], [ %x, %left_cond_true3 ], [ %x, %left_cond_true4 ], [ %x, %left_cond_true5 ], [ %x, %left_cond_true6 ]
ret i32 %lres
right:
%rcmp = icmp eq i32 %x, 0
br i1 %rcmp, label %right_cond_true, label %right_cond_false
right_cond_true:
br label %right_ret
right_cond_false:
br label %right_ret
right_ret:
%rres = phi i32 [ %x, %right_cond_true ], [ %x, %right_cond_false ]
ret i32 %rres
}