[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / CodeGen / X86 / GlobalISel / x86_64-select-srem.mir
blob0988883145bcdf0de31166a69821d47e62bf2c81
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 --- |
5   ; ModuleID = 'srem.ll'
6   source_filename = "srem.ll"
7   target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9   define i8 @test_srem_i8(i8 %arg1, i8 %arg2) {
10     %res = srem i8 %arg1, %arg2
11     ret i8 %res
12   }
14   define i16 @test_srem_i16(i16 %arg1, i16 %arg2) {
15     %res = srem i16 %arg1, %arg2
16     ret i16 %res
17   }
19   define i32 @test_srem_i32(i32 %arg1, i32 %arg2) {
20     %res = srem i32 %arg1, %arg2
21     ret i32 %res
22   }
24   define i64 @test_srem_i64(i64 %arg1, i64 %arg2) {
25     %res = srem i64 %arg1, %arg2
26     ret i64 %res
27   }
29 ...
30 ---
31 name:            test_srem_i8
32 alignment:       16
33 exposesReturnsTwice: false
34 legalized:       true
35 regBankSelected: true
36 selected:        false
37 failedISel:      false
38 tracksRegLiveness: true
39 registers:
40   - { id: 0, class: gpr, preferred-register: '' }
41   - { id: 1, class: gpr, preferred-register: '' }
42   - { id: 2, class: gpr, preferred-register: '' }
43   - { id: 3, class: gpr, preferred-register: '' }
44   - { id: 4, class: gpr, preferred-register: '' }
45 liveins:
46 frameInfo:
47   isFrameAddressTaken: false
48   isReturnAddressTaken: false
49   hasStackMap:     false
50   hasPatchPoint:   false
51   stackSize:       0
52   offsetAdjustment: 0
53   maxAlignment:    0
54   adjustsStack:    false
55   hasCalls:        false
56   stackProtector:  ''
57   maxCallFrameSize: 4294967295
58   hasOpaqueSPAdjustment: false
59   hasVAStart:      false
60   hasMustTailInVarArgFunc: false
61   localFrameSize:  0
62   savePoint:       ''
63   restorePoint:    ''
64 fixedStack:
65 stack:
66 constants:
67 body:             |
68   bb.1 (%ir-block.0):
69     liveins: $edi, $esi
71     ; CHECK-LABEL: name: test_srem_i8
72     ; CHECK: liveins: $edi, $esi
73     ; CHECK-NEXT: {{  $}}
74     ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $edi
75     ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
76     ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr32 = COPY $esi
77     ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr8 = COPY [[COPY2]].sub_8bit
78     ; CHECK-NEXT: $ax = MOVSX16rr8 [[COPY1]]
79     ; CHECK-NEXT: IDIV8r [[COPY3]], implicit-def $al, implicit-def $ah, implicit-def $eflags, implicit $ax
80     ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gr16 = COPY $ax
81     ; CHECK-NEXT: [[SHR16ri:%[0-9]+]]:gr16 = SHR16ri [[COPY4]], 8, implicit-def $eflags
82     ; CHECK-NEXT: [[SUBREG_TO_REG:%[0-9]+]]:gr8 = SUBREG_TO_REG 0, [[SHR16ri]], %subreg.sub_8bit
83     ; CHECK-NEXT: $al = COPY [[SUBREG_TO_REG]]
84     ; CHECK-NEXT: RET 0, implicit $al
85     %2:gpr(s32) = COPY $edi
86     %0:gpr(s8) = G_TRUNC %2(s32)
87     %3:gpr(s32) = COPY $esi
88     %1:gpr(s8) = G_TRUNC %3(s32)
89     %4:gpr(s8) = G_SREM %0, %1
90     $al = COPY %4(s8)
91     RET 0, implicit $al
93 ...
94 ---
95 name:            test_srem_i16
96 alignment:       16
97 exposesReturnsTwice: false
98 legalized:       true
99 regBankSelected: true
100 selected:        false
101 failedISel:      false
102 tracksRegLiveness: true
103 registers:
104   - { id: 0, class: gpr, preferred-register: '' }
105   - { id: 1, class: gpr, preferred-register: '' }
106   - { id: 2, class: gpr, preferred-register: '' }
107   - { id: 3, class: gpr, preferred-register: '' }
108   - { id: 4, class: gpr, preferred-register: '' }
109 liveins:
110 frameInfo:
111   isFrameAddressTaken: false
112   isReturnAddressTaken: false
113   hasStackMap:     false
114   hasPatchPoint:   false
115   stackSize:       0
116   offsetAdjustment: 0
117   maxAlignment:    0
118   adjustsStack:    false
119   hasCalls:        false
120   stackProtector:  ''
121   maxCallFrameSize: 4294967295
122   hasOpaqueSPAdjustment: false
123   hasVAStart:      false
124   hasMustTailInVarArgFunc: false
125   localFrameSize:  0
126   savePoint:       ''
127   restorePoint:    ''
128 fixedStack:
129 stack:
130 constants:
131 body:             |
132   bb.1 (%ir-block.0):
133     liveins: $edi, $esi
135     ; CHECK-LABEL: name: test_srem_i16
136     ; CHECK: liveins: $edi, $esi
137     ; CHECK-NEXT: {{  $}}
138     ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $edi
139     ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit
140     ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr32 = COPY $esi
141     ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr16 = COPY [[COPY2]].sub_16bit
142     ; CHECK-NEXT: $ax = COPY [[COPY1]]
143     ; CHECK-NEXT: CWD implicit-def $ax, implicit-def $dx, implicit $ax
144     ; CHECK-NEXT: IDIV16r [[COPY3]], implicit-def $ax, implicit-def $dx, implicit-def $eflags, implicit $ax, implicit $dx
145     ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gr16 = COPY $dx
146     ; CHECK-NEXT: $ax = COPY [[COPY4]]
147     ; CHECK-NEXT: RET 0, implicit $ax
148     %2:gpr(s32) = COPY $edi
149     %0:gpr(s16) = G_TRUNC %2(s32)
150     %3:gpr(s32) = COPY $esi
151     %1:gpr(s16) = G_TRUNC %3(s32)
152     %4:gpr(s16) = G_SREM %0, %1
153     $ax = COPY %4(s16)
154     RET 0, implicit $ax
158 name:            test_srem_i32
159 alignment:       16
160 exposesReturnsTwice: false
161 legalized:       true
162 regBankSelected: true
163 selected:        false
164 failedISel:      false
165 tracksRegLiveness: true
166 registers:
167   - { id: 0, class: gpr, preferred-register: '' }
168   - { id: 1, class: gpr, preferred-register: '' }
169   - { id: 2, class: gpr, preferred-register: '' }
170 liveins:
171 frameInfo:
172   isFrameAddressTaken: false
173   isReturnAddressTaken: false
174   hasStackMap:     false
175   hasPatchPoint:   false
176   stackSize:       0
177   offsetAdjustment: 0
178   maxAlignment:    0
179   adjustsStack:    false
180   hasCalls:        false
181   stackProtector:  ''
182   maxCallFrameSize: 4294967295
183   hasOpaqueSPAdjustment: false
184   hasVAStart:      false
185   hasMustTailInVarArgFunc: false
186   localFrameSize:  0
187   savePoint:       ''
188   restorePoint:    ''
189 fixedStack:
190 stack:
191 constants:
192 body:             |
193   bb.1 (%ir-block.0):
194     liveins: $edi, $esi
196     ; CHECK-LABEL: name: test_srem_i32
197     ; CHECK: liveins: $edi, $esi
198     ; CHECK-NEXT: {{  $}}
199     ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $edi
200     ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr32 = COPY $esi
201     ; CHECK-NEXT: $eax = COPY [[COPY]]
202     ; CHECK-NEXT: CDQ implicit-def $eax, implicit-def $edx, implicit $eax
203     ; CHECK-NEXT: IDIV32r [[COPY1]], implicit-def $eax, implicit-def $edx, implicit-def $eflags, implicit $eax, implicit $edx
204     ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr32 = COPY $edx
205     ; CHECK-NEXT: $eax = COPY [[COPY2]]
206     ; CHECK-NEXT: RET 0, implicit $eax
207     %0:gpr(s32) = COPY $edi
208     %1:gpr(s32) = COPY $esi
209     %2:gpr(s32) = G_SREM %0, %1
210     $eax = COPY %2(s32)
211     RET 0, implicit $eax
215 name:            test_srem_i64
216 alignment:       16
217 exposesReturnsTwice: false
218 legalized:       true
219 regBankSelected: true
220 selected:        false
221 failedISel:      false
222 tracksRegLiveness: true
223 registers:
224   - { id: 0, class: gpr, preferred-register: '' }
225   - { id: 1, class: gpr, preferred-register: '' }
226   - { id: 2, class: gpr, preferred-register: '' }
227 liveins:
228 frameInfo:
229   isFrameAddressTaken: false
230   isReturnAddressTaken: false
231   hasStackMap:     false
232   hasPatchPoint:   false
233   stackSize:       0
234   offsetAdjustment: 0
235   maxAlignment:    0
236   adjustsStack:    false
237   hasCalls:        false
238   stackProtector:  ''
239   maxCallFrameSize: 4294967295
240   hasOpaqueSPAdjustment: false
241   hasVAStart:      false
242   hasMustTailInVarArgFunc: false
243   localFrameSize:  0
244   savePoint:       ''
245   restorePoint:    ''
246 fixedStack:
247 stack:
248 constants:
249 body:             |
250   bb.1 (%ir-block.0):
251     liveins: $rdi, $rsi
253     ; CHECK-LABEL: name: test_srem_i64
254     ; CHECK: liveins: $rdi, $rsi
255     ; CHECK-NEXT: {{  $}}
256     ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
257     ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr64 = COPY $rsi
258     ; CHECK-NEXT: $rax = COPY [[COPY]]
259     ; CHECK-NEXT: CQO implicit-def $rax, implicit-def $rdx, implicit $rax
260     ; CHECK-NEXT: IDIV64r [[COPY1]], implicit-def $rax, implicit-def $rdx, implicit-def $eflags, implicit $rax, implicit $rdx
261     ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr64 = COPY $rdx
262     ; CHECK-NEXT: $rax = COPY [[COPY2]]
263     ; CHECK-NEXT: RET 0, implicit $rax
264     %0:gpr(s64) = COPY $rdi
265     %1:gpr(s64) = COPY $rsi
266     %2:gpr(s64) = G_SREM %0, %1
267     $rax = COPY %2(s64)
268     RET 0, implicit $rax