and-mask-removal.ll
5.66 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
; RUN: llc -mtriple=arm64-apple-darwin < %s | FileCheck %s
@board = common global [400 x i8] zeroinitializer, align 1
@next_string = common global i32 0, align 4
@string_number = common global [400 x i32] zeroinitializer, align 4
; Function Attrs: nounwind ssp
define void @new_position(i32 %pos) {
entry:
%idxprom = sext i32 %pos to i64
%arrayidx = getelementptr inbounds [400 x i8], [400 x i8]* @board, i64 0, i64 %idxprom
%tmp = load i8, i8* %arrayidx, align 1
%.off = add i8 %tmp, -1
%switch = icmp ult i8 %.off, 2
br i1 %switch, label %if.then, label %if.end
if.then: ; preds = %entry
%tmp1 = load i32, i32* @next_string, align 4
%arrayidx8 = getelementptr inbounds [400 x i32], [400 x i32]* @string_number, i64 0, i64 %idxprom
store i32 %tmp1, i32* %arrayidx8, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
; CHECK-LABEL: new_position
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test8_0(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 74
%1 = icmp ult i8 %0, -20
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_0
; CHECK: and
; CHECK: ret
}
define zeroext i1 @test8_1(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 246
%1 = icmp uge i8 %0, 90
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_1
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test8_2(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 227
%1 = icmp ne i8 %0, 179
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_2
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test8_3(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 201
%1 = icmp eq i8 %0, 154
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_3
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test8_4(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, -79
%1 = icmp ne i8 %0, -40
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_4
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test8_5(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 133
%1 = icmp uge i8 %0, -105
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_5
; CHECK: and
; CHECK: ret
}
define zeroext i1 @test8_6(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, -58
%1 = icmp uge i8 %0, 155
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_6
; CHECK: and
; CHECK: ret
}
define zeroext i1 @test8_7(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 225
%1 = icmp ult i8 %0, 124
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_7
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test8_8(i8 zeroext %x) align 2 {
entry:
%0 = add i8 %x, 190
%1 = icmp uge i8 %0, 1
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test8_8
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test16_0(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, -46989
%1 = icmp ne i16 %0, -41903
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_0
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test16_2(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, 16882
%1 = icmp ule i16 %0, -24837
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_2
; CHECK: mov [[CST:w[0-9]+]], #16882
; CHECK: add [[ADD:w[0-9]+]], w0, [[CST]]
; CHECK: cmp {{.*}}, [[ADD]], uxth
; CHECK: ret
}
define zeroext i1 @test16_3(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, 29283
%1 = icmp ne i16 %0, 16947
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_3
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test16_4(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, -35551
%1 = icmp uge i16 %0, 15677
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_4
; CHECK: mov [[CST:w[0-9]+]], #29985
; CHECK: add [[ADD:w[0-9]+]], w0, [[CST]]
; CHECK: cmp {{.*}}, [[ADD]], uxth
; CHECK: ret
}
define zeroext i1 @test16_5(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, -25214
%1 = icmp ne i16 %0, -1932
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_5
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test16_6(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, -32194
%1 = icmp uge i16 %0, -41215
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_6
; CHECK-NOT: and
; CHECK: ret
}
define zeroext i1 @test16_7(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, 9272
%1 = icmp uge i16 %0, -42916
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_7
; CHECK: mov [[CST:w[0-9]+]], #9272
; CHECK: add [[ADD:w[0-9]+]], w0, [[CST]]
; CHECK: cmp {{.*}}, [[ADD]], uxth
; CHECK: ret
}
define zeroext i1 @test16_8(i16 zeroext %x) align 2 {
entry:
%0 = add i16 %x, -63749
%1 = icmp ne i16 %0, 6706
br i1 %1, label %ret_true, label %ret_false
ret_false:
ret i1 false
ret_true:
ret i1 true
; CHECK-LABEL: test16_8
; CHECK-NOT: and
; CHECK: ret
}