1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s
4 define i64 @and1(i64 %x) {
7 ; CHECK-NEXT: movabsq $-2147483649, %rax # imm = 0xFFFFFFFF7FFFFFFF
8 ; CHECK-NEXT: andq %rdi, %rax
10 %a = and i64 %x, 18446744071562067967 ; clear bit 31
14 define i64 @and2(i64 %x) {
17 ; CHECK-NEXT: movabsq $-4294967297, %rax # imm = 0xFFFFFFFEFFFFFFFF
18 ; CHECK-NEXT: andq %rdi, %rax
20 %a = and i64 %x, 18446744069414584319 ; clear bit 32
24 define i64 @and3(i64 %x) {
27 ; CHECK-NEXT: movabsq $-4611686018427387905, %rax # imm = 0xBFFFFFFFFFFFFFFF
28 ; CHECK-NEXT: andq %rdi, %rax
30 %a = and i64 %x, 13835058055282163711 ; clear bit 62
34 define i64 @and4(i64 %x) {
37 ; CHECK-NEXT: movabsq $9223372036854775807, %rax # imm = 0x7FFFFFFFFFFFFFFF
38 ; CHECK-NEXT: andq %rdi, %rax
40 %a = and i64 %x, 9223372036854775807 ; clear bit 63
44 define i64 @or1(i64 %x) {
47 ; CHECK-NEXT: movl $2147483648, %eax # imm = 0x80000000
48 ; CHECK-NEXT: orq %rdi, %rax
50 %a = or i64 %x, 2147483648 ; set bit 31
54 define i64 @or2(i64 %x) {
57 ; CHECK-NEXT: movabsq $4294967296, %rax # imm = 0x100000000
58 ; CHECK-NEXT: orq %rdi, %rax
60 %a = or i64 %x, 4294967296 ; set bit 32
64 define i64 @or3(i64 %x) {
67 ; CHECK-NEXT: movabsq $4611686018427387904, %rax # imm = 0x4000000000000000
68 ; CHECK-NEXT: orq %rdi, %rax
70 %a = or i64 %x, 4611686018427387904 ; set bit 62
74 define i64 @or4(i64 %x) {
77 ; CHECK-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
78 ; CHECK-NEXT: orq %rdi, %rax
80 %a = or i64 %x, 9223372036854775808 ; set bit 63
84 define i64 @xor1(i64 %x) {
87 ; CHECK-NEXT: movl $2147483648, %eax # imm = 0x80000000
88 ; CHECK-NEXT: xorq %rdi, %rax
90 %a = xor i64 %x, 2147483648 ; toggle bit 31
94 define i64 @xor2(i64 %x) {
97 ; CHECK-NEXT: movabsq $4294967296, %rax # imm = 0x100000000
98 ; CHECK-NEXT: xorq %rdi, %rax
100 %a = xor i64 %x, 4294967296 ; toggle bit 32
104 define i64 @xor3(i64 %x) {
107 ; CHECK-NEXT: movabsq $4611686018427387904, %rax # imm = 0x4000000000000000
108 ; CHECK-NEXT: xorq %rdi, %rax
110 %a = xor i64 %x, 4611686018427387904 ; toggle bit 62
114 define i64 @xor4(i64 %x) {
117 ; CHECK-NEXT: movabsq $-9223372036854775808, %rax # imm = 0x8000000000000000
118 ; CHECK-NEXT: xorq %rdi, %rax
120 %a = xor i64 %x, 9223372036854775808 ; toggle bit 63
124 define i64 @and1_optsize(i64 %x) optsize {
125 ; CHECK-LABEL: and1_optsize:
127 ; CHECK-NEXT: movq %rdi, %rax
128 ; CHECK-NEXT: btrq $31, %rax
130 %a = and i64 %x, 18446744071562067967 ; clear bit 31
134 define i64 @and2_optsize(i64 %x) optsize {
135 ; CHECK-LABEL: and2_optsize:
137 ; CHECK-NEXT: movq %rdi, %rax
138 ; CHECK-NEXT: btrq $32, %rax
140 %a = and i64 %x, 18446744069414584319 ; clear bit 32
144 define i64 @and3_optsize(i64 %x) optsize {
145 ; CHECK-LABEL: and3_optsize:
147 ; CHECK-NEXT: movq %rdi, %rax
148 ; CHECK-NEXT: btrq $62, %rax
150 %a = and i64 %x, 13835058055282163711 ; clear bit 62
154 define i64 @and4_optsize(i64 %x) optsize {
155 ; CHECK-LABEL: and4_optsize:
157 ; CHECK-NEXT: movq %rdi, %rax
158 ; CHECK-NEXT: btrq $63, %rax
160 %a = and i64 %x, 9223372036854775807 ; clear bit 63
164 define i64 @or1_optsize(i64 %x) optsize {
165 ; CHECK-LABEL: or1_optsize:
167 ; CHECK-NEXT: movq %rdi, %rax
168 ; CHECK-NEXT: btsq $31, %rax
170 %a = or i64 %x, 2147483648 ; set bit 31
174 define i64 @or2_optsize(i64 %x) optsize {
175 ; CHECK-LABEL: or2_optsize:
177 ; CHECK-NEXT: movq %rdi, %rax
178 ; CHECK-NEXT: btsq $32, %rax
180 %a = or i64 %x, 4294967296 ; set bit 32
184 define i64 @or3_optsize(i64 %x) optsize {
185 ; CHECK-LABEL: or3_optsize:
187 ; CHECK-NEXT: movq %rdi, %rax
188 ; CHECK-NEXT: btsq $62, %rax
190 %a = or i64 %x, 4611686018427387904 ; set bit 62
194 define i64 @or4_optsize(i64 %x) optsize {
195 ; CHECK-LABEL: or4_optsize:
197 ; CHECK-NEXT: movq %rdi, %rax
198 ; CHECK-NEXT: btsq $63, %rax
200 %a = or i64 %x, 9223372036854775808 ; set bit 63
204 define i64 @xor1_optsize(i64 %x) optsize {
205 ; CHECK-LABEL: xor1_optsize:
207 ; CHECK-NEXT: movq %rdi, %rax
208 ; CHECK-NEXT: btcq $31, %rax
210 %a = xor i64 %x, 2147483648 ; toggle bit 31
214 define i64 @xor2_optsize(i64 %x) optsize {
215 ; CHECK-LABEL: xor2_optsize:
217 ; CHECK-NEXT: movq %rdi, %rax
218 ; CHECK-NEXT: btcq $32, %rax
220 %a = xor i64 %x, 4294967296 ; toggle bit 32
224 define i64 @xor3_optsize(i64 %x) optsize {
225 ; CHECK-LABEL: xor3_optsize:
227 ; CHECK-NEXT: movq %rdi, %rax
228 ; CHECK-NEXT: btcq $62, %rax
230 %a = xor i64 %x, 4611686018427387904 ; toggle bit 62
234 define i64 @xor4_optsize(i64 %x) optsize {
235 ; CHECK-LABEL: xor4_optsize:
237 ; CHECK-NEXT: movq %rdi, %rax
238 ; CHECK-NEXT: btcq $63, %rax
240 %a = xor i64 %x, 9223372036854775808 ; toggle bit 63
244 define i64 @and1_pgso(i64 %x) !prof !14 {
245 ; CHECK-LABEL: and1_pgso:
247 ; CHECK-NEXT: movq %rdi, %rax
248 ; CHECK-NEXT: btrq $31, %rax
250 %a = and i64 %x, 18446744071562067967 ; clear bit 31
254 define i64 @and2_pgso(i64 %x) !prof !14 {
255 ; CHECK-LABEL: and2_pgso:
257 ; CHECK-NEXT: movq %rdi, %rax
258 ; CHECK-NEXT: btrq $32, %rax
260 %a = and i64 %x, 18446744069414584319 ; clear bit 32
264 define i64 @and3_pgso(i64 %x) !prof !14 {
265 ; CHECK-LABEL: and3_pgso:
267 ; CHECK-NEXT: movq %rdi, %rax
268 ; CHECK-NEXT: btrq $62, %rax
270 %a = and i64 %x, 13835058055282163711 ; clear bit 62
274 define i64 @and4_pgso(i64 %x) !prof !14 {
275 ; CHECK-LABEL: and4_pgso:
277 ; CHECK-NEXT: movq %rdi, %rax
278 ; CHECK-NEXT: btrq $63, %rax
280 %a = and i64 %x, 9223372036854775807 ; clear bit 63
284 define i64 @or1_pgso(i64 %x) !prof !14 {
285 ; CHECK-LABEL: or1_pgso:
287 ; CHECK-NEXT: movq %rdi, %rax
288 ; CHECK-NEXT: btsq $31, %rax
290 %a = or i64 %x, 2147483648 ; set bit 31
294 define i64 @or2_pgso(i64 %x) !prof !14 {
295 ; CHECK-LABEL: or2_pgso:
297 ; CHECK-NEXT: movq %rdi, %rax
298 ; CHECK-NEXT: btsq $32, %rax
300 %a = or i64 %x, 4294967296 ; set bit 32
304 define i64 @or3_pgso(i64 %x) !prof !14 {
305 ; CHECK-LABEL: or3_pgso:
307 ; CHECK-NEXT: movq %rdi, %rax
308 ; CHECK-NEXT: btsq $62, %rax
310 %a = or i64 %x, 4611686018427387904 ; set bit 62
314 define i64 @or4_pgso(i64 %x) !prof !14 {
315 ; CHECK-LABEL: or4_pgso:
317 ; CHECK-NEXT: movq %rdi, %rax
318 ; CHECK-NEXT: btsq $63, %rax
320 %a = or i64 %x, 9223372036854775808 ; set bit 63
324 define i64 @xor1_pgso(i64 %x) !prof !14 {
325 ; CHECK-LABEL: xor1_pgso:
327 ; CHECK-NEXT: movq %rdi, %rax
328 ; CHECK-NEXT: btcq $31, %rax
330 %a = xor i64 %x, 2147483648 ; toggle bit 31
334 define i64 @xor2_pgso(i64 %x) !prof !14 {
335 ; CHECK-LABEL: xor2_pgso:
337 ; CHECK-NEXT: movq %rdi, %rax
338 ; CHECK-NEXT: btcq $32, %rax
340 %a = xor i64 %x, 4294967296 ; toggle bit 32
344 define i64 @xor3_pgso(i64 %x) !prof !14 {
345 ; CHECK-LABEL: xor3_pgso:
347 ; CHECK-NEXT: movq %rdi, %rax
348 ; CHECK-NEXT: btcq $62, %rax
350 %a = xor i64 %x, 4611686018427387904 ; toggle bit 62
354 define i64 @xor4_pgso(i64 %x) !prof !14 {
355 ; CHECK-LABEL: xor4_pgso:
357 ; CHECK-NEXT: movq %rdi, %rax
358 ; CHECK-NEXT: btcq $63, %rax
360 %a = xor i64 %x, 9223372036854775808 ; toggle bit 63
364 !llvm.module.flags = !{!0}
365 !0 = !{i32 1, !"ProfileSummary", !1}
366 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
367 !2 = !{!"ProfileFormat", !"InstrProf"}
368 !3 = !{!"TotalCount", i64 10000}
369 !4 = !{!"MaxCount", i64 10}
370 !5 = !{!"MaxInternalCount", i64 1}
371 !6 = !{!"MaxFunctionCount", i64 1000}
372 !7 = !{!"NumCounts", i64 3}
373 !8 = !{!"NumFunctions", i64 3}
374 !9 = !{!"DetailedSummary", !10}
375 !10 = !{!11, !12, !13}
376 !11 = !{i32 10000, i64 100, i32 1}
377 !12 = !{i32 999000, i64 100, i32 1}
378 !13 = !{i32 999999, i64 1, i32 2}
379 !14 = !{!"function_entry_count", i64 0}