3
define i32 @test1(i32 %x) nounwind uwtable ssp {
5
%retval = alloca i32, align 4
6
%x.addr = alloca i32, align 4
7
store i32 %x, i32* %x.addr, align 4
8
%tmp = load i32, i32* %x.addr, align 4
9
%cmp = icmp sgt i32 %tmp, 1
10
%conv = zext i1 %cmp to i32
11
%conv1 = sext i32 %conv to i64
12
%expval = call i64 @llvm.expect.i64(i64 %conv1, i64 1)
13
%tobool = icmp ne i64 %expval, 0
14
br i1 %tobool, label %if.then, label %if.end
16
if.then: ; preds = %entry
17
%call = call i32 (...) @f()
18
store i32 %call, i32* %retval
21
if.end: ; preds = %entry
22
store i32 1, i32* %retval
25
return: ; preds = %if.end, %if.then
26
%0 = load i32, i32* %retval
30
declare i64 @llvm.expect.i64(i64, i64) nounwind readnone
34
define i32 @test2(i32 %x) nounwind uwtable ssp {
36
%retval = alloca i32, align 4
37
%x.addr = alloca i32, align 4
38
store i32 %x, i32* %x.addr, align 4
39
%tmp = load i32, i32* %x.addr, align 4
40
%conv = sext i32 %tmp to i64
41
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
42
%tobool = icmp ne i64 %expval, 0
43
br i1 %tobool, label %if.then, label %if.end
45
if.then: ; preds = %entry
46
%call = call i32 (...) @f()
47
store i32 %call, i32* %retval
50
if.end: ; preds = %entry
51
store i32 1, i32* %retval
54
return: ; preds = %if.end, %if.then
55
%0 = load i32, i32* %retval
59
define i32 @test3(i32 %x) nounwind uwtable ssp {
61
%retval = alloca i32, align 4
62
%x.addr = alloca i32, align 4
63
store i32 %x, i32* %x.addr, align 4
64
%tmp = load i32, i32* %x.addr, align 4
65
%tobool = icmp ne i32 %tmp, 0
66
%lnot = xor i1 %tobool, true
67
%lnot.ext = zext i1 %lnot to i32
68
%conv = sext i32 %lnot.ext to i64
69
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
70
%tobool1 = icmp ne i64 %expval, 0
71
br i1 %tobool1, label %if.then, label %if.end
73
if.then: ; preds = %entry
74
%call = call i32 (...) @f()
75
store i32 %call, i32* %retval
78
if.end: ; preds = %entry
79
store i32 1, i32* %retval
82
return: ; preds = %if.end, %if.then
83
%0 = load i32, i32* %retval
87
define i32 @test4(i32 %x) nounwind uwtable ssp {
89
%retval = alloca i32, align 4
90
%x.addr = alloca i32, align 4
91
store i32 %x, i32* %x.addr, align 4
92
%tmp = load i32, i32* %x.addr, align 4
93
%tobool = icmp ne i32 %tmp, 0
94
%lnot = xor i1 %tobool, true
95
%lnot1 = xor i1 %lnot, true
96
%lnot.ext = zext i1 %lnot1 to i32
97
%conv = sext i32 %lnot.ext to i64
98
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
99
%tobool2 = icmp ne i64 %expval, 0
100
br i1 %tobool2, label %if.then, label %if.end
102
if.then: ; preds = %entry
103
%call = call i32 (...) @f()
104
store i32 %call, i32* %retval
107
if.end: ; preds = %entry
108
store i32 1, i32* %retval
111
return: ; preds = %if.end, %if.then
112
%0 = load i32, i32* %retval
116
define i32 @test5(i32 %x) nounwind uwtable ssp {
118
%retval = alloca i32, align 4
119
%x.addr = alloca i32, align 4
120
store i32 %x, i32* %x.addr, align 4
121
%tmp = load i32, i32* %x.addr, align 4
122
%cmp = icmp slt i32 %tmp, 0
123
%conv = zext i1 %cmp to i32
124
%conv1 = sext i32 %conv to i64
125
%expval = call i64 @llvm.expect.i64(i64 %conv1, i64 0)
126
%tobool = icmp ne i64 %expval, 0
127
br i1 %tobool, label %if.then, label %if.end
129
if.then: ; preds = %entry
130
%call = call i32 (...) @f()
131
store i32 %call, i32* %retval
134
if.end: ; preds = %entry
135
store i32 1, i32* %retval
138
return: ; preds = %if.end, %if.then
139
%0 = load i32, i32* %retval
143
define i32 @test6(i32 %x) nounwind uwtable ssp {
145
%retval = alloca i32, align 4
146
%x.addr = alloca i32, align 4
147
store i32 %x, i32* %x.addr, align 4
148
%tmp = load i32, i32* %x.addr, align 4
149
%conv = sext i32 %tmp to i64
150
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
151
switch i64 %expval, label %sw.epilog [
156
sw.bb: ; preds = %entry, %entry
157
store i32 0, i32* %retval
160
sw.epilog: ; preds = %entry
161
store i32 1, i32* %retval
164
return: ; preds = %sw.epilog, %sw.bb
165
%0 = load i32, i32* %retval
169
define i32 @test7(i32 %x) nounwind uwtable ssp {
171
%retval = alloca i32, align 4
172
%x.addr = alloca i32, align 4
173
store i32 %x, i32* %x.addr, align 4
174
%tmp = load i32, i32* %x.addr, align 4
175
%conv = sext i32 %tmp to i64
176
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
177
switch i64 %expval, label %sw.epilog [
182
sw.bb: ; preds = %entry, %entry
183
%tmp1 = load i32, i32* %x.addr, align 4
184
store i32 %tmp1, i32* %retval
187
sw.epilog: ; preds = %entry
188
store i32 0, i32* %retval
191
return: ; preds = %sw.epilog, %sw.bb
192
%0 = load i32, i32* %retval
196
define i32 @test8(i32 %x) nounwind uwtable ssp {
198
%retval = alloca i32, align 4
199
%x.addr = alloca i32, align 4
200
store i32 %x, i32* %x.addr, align 4
201
%tmp = load i32, i32* %x.addr, align 4
202
%cmp = icmp sgt i32 %tmp, 1
203
%conv = zext i1 %cmp to i32
204
%expval = call i32 @llvm.expect.i32(i32 %conv, i32 1)
205
%tobool = icmp ne i32 %expval, 0
206
br i1 %tobool, label %if.then, label %if.end
208
if.then: ; preds = %entry
209
%call = call i32 (...) @f()
210
store i32 %call, i32* %retval
213
if.end: ; preds = %entry
214
store i32 1, i32* %retval
217
return: ; preds = %if.end, %if.then
218
%0 = load i32, i32* %retval
222
declare i32 @llvm.expect.i32(i32, i32) nounwind readnone