1
- ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2
1
; Check that 64-bit division is bypassed correctly.
3
2
; RUN: llc < %s -mtriple=x86_64-- -mattr=-idivq-to-divl | FileCheck %s --check-prefixes=CHECK,FAST-DIVQ
4
3
; RUN: llc < %s -mtriple=x86_64-- -mattr=+idivq-to-divl | FileCheck %s --check-prefixes=CHECK,SLOW-DIVQ
13
12
; RUN: llc < %s -mtriple=x86_64-- -mcpu=skylake | FileCheck %s --check-prefixes=CHECK,SLOW-DIVQ
14
13
; RUN: llc < %s -mtriple=x86_64-- -mcpu=alderlake | FileCheck %s --check-prefixes=CHECK,SLOW-DIVQ
15
14
; AMD
16
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=barcelona | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
17
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=btver1 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
18
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=btver2 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
19
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver1 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
20
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver2 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
21
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver3 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
22
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver4 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
23
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver1 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
24
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver2 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
25
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver3 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
26
- ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver4 | FileCheck %s --check-prefixes=CHECK,FAST -DIVQ
15
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=barcelona | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
16
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=btver1 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
17
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=btver2 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
18
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver1 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
19
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver2 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
20
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver3 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
21
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=bdver4 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
22
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver1 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
23
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver2 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
24
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver3 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
25
+ ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver4 | FileCheck %s --check-prefixes=CHECK,SLOW -DIVQ
27
26
28
27
; Additional tests for 64-bit divide bypass
29
28
@@ -41,18 +40,18 @@ define i64 @sdiv_quotient(i64 %a, i64 %b) nounwind {
41
40
;
42
41
; SLOW-DIVQ-LABEL: sdiv_quotient:
43
42
; SLOW-DIVQ: # %bb.0:
44
- ; SLOW-DIVQ-NEXT: movq %rdi, %rax
45
- ; SLOW-DIVQ-NEXT: movq %rdi, %rcx
46
- ; SLOW-DIVQ-NEXT: orq %rsi, %rcx
47
- ; SLOW-DIVQ-NEXT: shrq $32, %rcx
43
+ ; SLOW-DIVQ-DAG: movq %rdi, %rax
44
+ ; SLOW-DIVQ-DAG: movq %rdi, %rcx
45
+ ; SLOW-DIVQ-DAG: orq %rsi, %rcx
46
+ ; SLOW-DIVQ-DAG: shrq $32, %rcx
48
47
; SLOW-DIVQ-NEXT: je .LBB0_1
49
48
; SLOW-DIVQ-NEXT: # %bb.2:
50
49
; SLOW-DIVQ-NEXT: cqto
51
50
; SLOW-DIVQ-NEXT: idivq %rsi
52
51
; SLOW-DIVQ-NEXT: retq
53
52
; SLOW-DIVQ-NEXT: .LBB0_1:
54
- ; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax killed $rax
55
- ; SLOW-DIVQ-NEXT: xorl %edx, %edx
53
+ ; SLOW-DIVQ-DAG: # kill: def $eax killed $eax killed $rax
54
+ ; SLOW-DIVQ-DAG: xorl %edx, %edx
56
55
; SLOW-DIVQ-NEXT: divl %esi
57
56
; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax def $rax
58
57
; SLOW-DIVQ-NEXT: retq
@@ -93,19 +92,19 @@ define i64 @sdiv_remainder(i64 %a, i64 %b) nounwind {
93
92
;
94
93
; SLOW-DIVQ-LABEL: sdiv_remainder:
95
94
; SLOW-DIVQ: # %bb.0:
96
- ; SLOW-DIVQ-NEXT: movq %rdi, %rax
97
- ; SLOW-DIVQ-NEXT: movq %rdi, %rcx
98
- ; SLOW-DIVQ-NEXT: orq %rsi, %rcx
99
- ; SLOW-DIVQ-NEXT: shrq $32, %rcx
95
+ ; SLOW-DIVQ-DAG: movq %rdi, %rax
96
+ ; SLOW-DIVQ-DAG: movq %rdi, %rcx
97
+ ; SLOW-DIVQ-DAG: orq %rsi, %rcx
98
+ ; SLOW-DIVQ-DAG: shrq $32, %rcx
100
99
; SLOW-DIVQ-NEXT: je .LBB3_1
101
100
; SLOW-DIVQ-NEXT: # %bb.2:
102
101
; SLOW-DIVQ-NEXT: cqto
103
102
; SLOW-DIVQ-NEXT: idivq %rsi
104
103
; SLOW-DIVQ-NEXT: movq %rdx, %rax
105
104
; SLOW-DIVQ-NEXT: retq
106
105
; SLOW-DIVQ-NEXT: .LBB3_1:
107
- ; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax killed $rax
108
- ; SLOW-DIVQ-NEXT: xorl %edx, %edx
106
+ ; SLOW-DIVQ-DAG: # kill: def $eax killed $eax killed $rax
107
+ ; SLOW-DIVQ-DAG: xorl %edx, %edx
109
108
; SLOW-DIVQ-NEXT: divl %esi
110
109
; SLOW-DIVQ-NEXT: movl %edx, %eax
111
110
; SLOW-DIVQ-NEXT: retq
@@ -148,19 +147,19 @@ define i64 @sdiv_quotient_and_remainder(i64 %a, i64 %b) nounwind {
148
147
;
149
148
; SLOW-DIVQ-LABEL: sdiv_quotient_and_remainder:
150
149
; SLOW-DIVQ: # %bb.0:
151
- ; SLOW-DIVQ-NEXT: movq %rdi, %rax
152
- ; SLOW-DIVQ-NEXT: movq %rdi, %rcx
153
- ; SLOW-DIVQ-NEXT: orq %rsi, %rcx
154
- ; SLOW-DIVQ-NEXT: shrq $32, %rcx
150
+ ; SLOW-DIVQ-DAG: movq %rdi, %rax
151
+ ; SLOW-DIVQ-DAG: movq %rdi, %rcx
152
+ ; SLOW-DIVQ-DAG: orq %rsi, %rcx
153
+ ; SLOW-DIVQ-DAG: shrq $32, %rcx
155
154
; SLOW-DIVQ-NEXT: je .LBB6_1
156
155
; SLOW-DIVQ-NEXT: # %bb.2:
157
156
; SLOW-DIVQ-NEXT: cqto
158
157
; SLOW-DIVQ-NEXT: idivq %rsi
159
158
; SLOW-DIVQ-NEXT: addq %rdx, %rax
160
159
; SLOW-DIVQ-NEXT: retq
161
160
; SLOW-DIVQ-NEXT: .LBB6_1:
162
- ; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax killed $rax
163
- ; SLOW-DIVQ-NEXT: xorl %edx, %edx
161
+ ; SLOW-DIVQ-DAG: # kill: def $eax killed $eax killed $rax
162
+ ; SLOW-DIVQ-DAG: xorl %edx, %edx
164
163
; SLOW-DIVQ-NEXT: divl %esi
165
164
; SLOW-DIVQ-NEXT: # kill: def $edx killed $edx def $rdx
166
165
; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax def $rax
@@ -214,18 +213,18 @@ define i64 @udiv_quotient(i64 %a, i64 %b) nounwind {
214
213
;
215
214
; SLOW-DIVQ-LABEL: udiv_quotient:
216
215
; SLOW-DIVQ: # %bb.0:
217
- ; SLOW-DIVQ-NEXT: movq %rdi, %rax
218
- ; SLOW-DIVQ-NEXT: movq %rdi, %rcx
219
- ; SLOW-DIVQ-NEXT: orq %rsi, %rcx
220
- ; SLOW-DIVQ-NEXT: shrq $32, %rcx
216
+ ; SLOW-DIVQ-DAG: movq %rdi, %rax
217
+ ; SLOW-DIVQ-DAG: movq %rdi, %rcx
218
+ ; SLOW-DIVQ-DAG: orq %rsi, %rcx
219
+ ; SLOW-DIVQ-DAG: shrq $32, %rcx
221
220
; SLOW-DIVQ-NEXT: je .LBB9_1
222
221
; SLOW-DIVQ-NEXT: # %bb.2:
223
222
; SLOW-DIVQ-NEXT: xorl %edx, %edx
224
223
; SLOW-DIVQ-NEXT: divq %rsi
225
224
; SLOW-DIVQ-NEXT: retq
226
225
; SLOW-DIVQ-NEXT: .LBB9_1:
227
- ; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax killed $rax
228
- ; SLOW-DIVQ-NEXT: xorl %edx, %edx
226
+ ; SLOW-DIVQ-DAG: # kill: def $eax killed $eax killed $rax
227
+ ; SLOW-DIVQ-DAG: xorl %edx, %edx
229
228
; SLOW-DIVQ-NEXT: divl %esi
230
229
; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax def $rax
231
230
; SLOW-DIVQ-NEXT: retq
@@ -266,19 +265,19 @@ define i64 @udiv_remainder(i64 %a, i64 %b) nounwind {
266
265
;
267
266
; SLOW-DIVQ-LABEL: udiv_remainder:
268
267
; SLOW-DIVQ: # %bb.0:
269
- ; SLOW-DIVQ-NEXT: movq %rdi, %rax
270
- ; SLOW-DIVQ-NEXT: movq %rdi, %rcx
271
- ; SLOW-DIVQ-NEXT: orq %rsi, %rcx
272
- ; SLOW-DIVQ-NEXT: shrq $32, %rcx
268
+ ; SLOW-DIVQ-DAG: movq %rdi, %rax
269
+ ; SLOW-DIVQ-DAG: movq %rdi, %rcx
270
+ ; SLOW-DIVQ-DAG: orq %rsi, %rcx
271
+ ; SLOW-DIVQ-DAG: shrq $32, %rcx
273
272
; SLOW-DIVQ-NEXT: je .LBB12_1
274
273
; SLOW-DIVQ-NEXT: # %bb.2:
275
274
; SLOW-DIVQ-NEXT: xorl %edx, %edx
276
275
; SLOW-DIVQ-NEXT: divq %rsi
277
276
; SLOW-DIVQ-NEXT: movq %rdx, %rax
278
277
; SLOW-DIVQ-NEXT: retq
279
278
; SLOW-DIVQ-NEXT: .LBB12_1:
280
- ; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax killed $rax
281
- ; SLOW-DIVQ-NEXT: xorl %edx, %edx
279
+ ; SLOW-DIVQ-DAG: # kill: def $eax killed $eax killed $rax
280
+ ; SLOW-DIVQ-DAG: xorl %edx, %edx
282
281
; SLOW-DIVQ-NEXT: divl %esi
283
282
; SLOW-DIVQ-NEXT: movl %edx, %eax
284
283
; SLOW-DIVQ-NEXT: retq
@@ -321,19 +320,19 @@ define i64 @udiv_quotient_and_remainder(i64 %a, i64 %b) nounwind {
321
320
;
322
321
; SLOW-DIVQ-LABEL: udiv_quotient_and_remainder:
323
322
; SLOW-DIVQ: # %bb.0:
324
- ; SLOW-DIVQ-NEXT: movq %rdi, %rax
325
- ; SLOW-DIVQ-NEXT: movq %rdi, %rcx
326
- ; SLOW-DIVQ-NEXT: orq %rsi, %rcx
327
- ; SLOW-DIVQ-NEXT: shrq $32, %rcx
323
+ ; SLOW-DIVQ-DAG: movq %rdi, %rax
324
+ ; SLOW-DIVQ-DAG: movq %rdi, %rcx
325
+ ; SLOW-DIVQ-DAG: orq %rsi, %rcx
326
+ ; SLOW-DIVQ-DAG: shrq $32, %rcx
328
327
; SLOW-DIVQ-NEXT: je .LBB15_1
329
328
; SLOW-DIVQ-NEXT: # %bb.2:
330
329
; SLOW-DIVQ-NEXT: xorl %edx, %edx
331
330
; SLOW-DIVQ-NEXT: divq %rsi
332
331
; SLOW-DIVQ-NEXT: addq %rdx, %rax
333
332
; SLOW-DIVQ-NEXT: retq
334
333
; SLOW-DIVQ-NEXT: .LBB15_1:
335
- ; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax killed $rax
336
- ; SLOW-DIVQ-NEXT: xorl %edx, %edx
334
+ ; SLOW-DIVQ-DAG: # kill: def $eax killed $eax killed $rax
335
+ ; SLOW-DIVQ-DAG: xorl %edx, %edx
337
336
; SLOW-DIVQ-NEXT: divl %esi
338
337
; SLOW-DIVQ-NEXT: # kill: def $edx killed $edx def $rdx
339
338
; SLOW-DIVQ-NEXT: # kill: def $eax killed $eax def $rax
0 commit comments