File: regbankcombiner-clamp-fmed3-const.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (257 lines) | stat: -rw-r--r-- 9,562 bytes parent folder | download | duplicates (2)
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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn-amd-mesa3d -mcpu=gfx1010 -run-pass=amdgpu-regbank-combiner -verify-machineinstrs %s -o - | FileCheck %s
---
name: test_fmed3_f32_known_nnan_ieee_true
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee: true
    dx10-clamp: true
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_f32_known_nnan_ieee_true
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
    ; CHECK-NEXT: [[FMUL:%[0-9]+]]:vgpr(s32) = G_FMUL [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[AMDGPU_CLAMP:%[0-9]+]]:vgpr(s32) = nnan G_AMDGPU_CLAMP [[FMUL]]
    ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CLAMP]](s32)
    %0:vgpr(s32) = COPY $vgpr0
    %2:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    %8:vgpr(s32) = COPY %2(s32)
    %3:vgpr(s32) = G_FMUL %0, %8
    %6:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    %5:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    %9:vgpr(s32) = COPY %5(s32)
    %10:vgpr(s32) = COPY %6(s32)
    %4:vgpr(s32) = nnan G_AMDGPU_FMED3 %3(s32), %9(s32), %10(s32)
    $vgpr0 = COPY %4(s32)
...

---
name: test_fmed3_f16_known_nnan_ieee_false
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee: false
    dx10-clamp: true
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_f16_known_nnan_ieee_false
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s16) = G_FCONSTANT half 0xH4000
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s16) = COPY [[C]](s16)
    ; CHECK-NEXT: [[FMUL:%[0-9]+]]:vgpr(s16) = G_FMUL [[TRUNC]], [[COPY1]]
    ; CHECK-NEXT: [[AMDGPU_CLAMP:%[0-9]+]]:vgpr(s16) = nnan G_AMDGPU_CLAMP [[FMUL]]
    ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[AMDGPU_CLAMP]](s16)
    ; CHECK-NEXT: $vgpr0 = COPY [[ANYEXT]](s32)
    %2:vgpr(s32) = COPY $vgpr0
    %0:vgpr(s16) = G_TRUNC %2(s32)
    %3:sgpr(s16) = G_FCONSTANT half 0xH4000
    %10:vgpr(s16) = COPY %3(s16)
    %4:vgpr(s16) = G_FMUL %0, %10
    %7:sgpr(s16) = G_FCONSTANT half 0xH3C00
    %6:sgpr(s16) = G_FCONSTANT half 0xH0000
    %11:vgpr(s16) = COPY %6(s16)
    %12:vgpr(s16) = COPY %7(s16)
    %5:vgpr(s16) = nnan G_AMDGPU_FMED3 %4(s16), %11(s16), %12(s16)
    %9:vgpr(s32) = G_ANYEXT %5(s16)
    $vgpr0 = COPY %9(s32)
...

---
name: test_fmed3_non_SNaN_input_ieee_true_dx10clamp_true
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee:            true
    dx10-clamp:      true
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_non_SNaN_input_ieee_true_dx10clamp_true
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 1.000000e+01
    ; CHECK-NEXT: [[FCANONICALIZE:%[0-9]+]]:vgpr(s32) = G_FCANONICALIZE [[COPY]]
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
    ; CHECK-NEXT: [[FMINNUM_IEEE:%[0-9]+]]:vgpr(s32) = G_FMINNUM_IEEE [[FCANONICALIZE]], [[COPY1]]
    ; CHECK-NEXT: [[AMDGPU_CLAMP:%[0-9]+]]:vgpr(s32) = G_AMDGPU_CLAMP [[FMINNUM_IEEE]]
    ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CLAMP]](s32)
    %0:vgpr(s32) = COPY $vgpr0
    %2:sgpr(s32) = G_FCONSTANT float 1.000000e+01
    %8:vgpr(s32) = G_FCANONICALIZE %0
    %9:vgpr(s32) = COPY %2(s32)
    %3:vgpr(s32) = G_FMINNUM_IEEE %8, %9
    %6:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    %5:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    %10:vgpr(s32) = COPY %5(s32)
    %11:vgpr(s32) = COPY %6(s32)
    %4:vgpr(s32) = G_AMDGPU_FMED3 %3(s32), %10(s32), %11(s32)
    $vgpr0 = COPY %4(s32)
...

---
name: test_fmed3_maybe_SNaN_input_zero_third_operand_ieee_true_dx10clamp_true
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee: true
    dx10-clamp: true
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_maybe_SNaN_input_zero_third_operand_ieee_true_dx10clamp_true
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
    ; CHECK-NEXT: [[FMUL:%[0-9]+]]:vgpr(s32) = G_FMUL [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[AMDGPU_CLAMP:%[0-9]+]]:vgpr(s32) = G_AMDGPU_CLAMP [[FMUL]]
    ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CLAMP]](s32)
    %0:vgpr(s32) = COPY $vgpr0
    %2:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    %8:vgpr(s32) = COPY %2(s32)
    %3:vgpr(s32) = G_FMUL %0, %8
    %6:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    %5:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    %9:vgpr(s32) = COPY %5(s32)
    %10:vgpr(s32) = COPY %6(s32)
    %4:vgpr(s32) = G_AMDGPU_FMED3 %3(s32), %9(s32), %10(s32)
    $vgpr0 = COPY %4(s32)
...

# FixMe: add tests with attributes #3 = {"no-nans-fp-math"="true"}

---
name: test_fmed3_f32_maybe_NaN_ieee_false
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee: false
    dx10-clamp: true
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_f32_maybe_NaN_ieee_false
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
    ; CHECK-NEXT: [[FMUL:%[0-9]+]]:vgpr(s32) = G_FMUL [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    ; CHECK-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[C2]](s32)
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C1]](s32)
    ; CHECK-NEXT: [[AMDGPU_FMED3_:%[0-9]+]]:vgpr(s32) = G_AMDGPU_FMED3 [[FMUL]], [[COPY2]], [[COPY3]]
    ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_FMED3_]](s32)
    %0:vgpr(s32) = COPY $vgpr0
    %2:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    %8:vgpr(s32) = COPY %2(s32)
    %3:vgpr(s32) = G_FMUL %0, %8
    %6:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    %5:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    %9:vgpr(s32) = COPY %5(s32)
    %10:vgpr(s32) = COPY %6(s32)
    %4:vgpr(s32) = G_AMDGPU_FMED3 %3(s32), %9(s32), %10(s32)
    $vgpr0 = COPY %4(s32)
...

---
name: test_fmed3_non_SNaN_input_ieee_true_dx10clamp_false
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee: true
    dx10-clamp: false
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_non_SNaN_input_ieee_true_dx10clamp_false
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 1.000000e+01
    ; CHECK-NEXT: [[FCANONICALIZE:%[0-9]+]]:vgpr(s32) = G_FCANONICALIZE [[COPY]]
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
    ; CHECK-NEXT: [[FMINNUM_IEEE:%[0-9]+]]:vgpr(s32) = G_FMINNUM_IEEE [[FCANONICALIZE]], [[COPY1]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    ; CHECK-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[C2]](s32)
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[C1]](s32)
    ; CHECK-NEXT: [[AMDGPU_FMED3_:%[0-9]+]]:vgpr(s32) = G_AMDGPU_FMED3 [[FMINNUM_IEEE]], [[COPY2]], [[COPY3]]
    ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_FMED3_]](s32)
    %0:vgpr(s32) = COPY $vgpr0
    %2:sgpr(s32) = G_FCONSTANT float 1.000000e+01
    %8:vgpr(s32) = G_FCANONICALIZE %0
    %9:vgpr(s32) = COPY %2(s32)
    %3:vgpr(s32) = G_FMINNUM_IEEE %8, %9
    %6:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    %5:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    %10:vgpr(s32) = COPY %5(s32)
    %11:vgpr(s32) = COPY %6(s32)
    %4:vgpr(s32) = G_AMDGPU_FMED3 %3(s32), %10(s32), %11(s32)
    $vgpr0 = COPY %4(s32)
...

---
name: test_fmed3_maybe_SNaN_input_ieee_true_dx10clamp_true
legalized: true
regBankSelected: true
tracksRegLiveness: true
machineFunctionInfo:
  mode:
    ieee: true
    dx10-clamp: true
body: |
  bb.1 :
    liveins: $vgpr0

    ; CHECK-LABEL: name: test_fmed3_maybe_SNaN_input_ieee_true_dx10clamp_true
    ; CHECK: liveins: $vgpr0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
    ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[C]](s32)
    ; CHECK-NEXT: [[FMUL:%[0-9]+]]:vgpr(s32) = G_FMUL [[COPY]], [[COPY1]]
    ; CHECK-NEXT: [[AMDGPU_CLAMP:%[0-9]+]]:vgpr(s32) = G_AMDGPU_CLAMP [[FMUL]]
    ; CHECK-NEXT: $vgpr0 = COPY [[AMDGPU_CLAMP]](s32)
    %0:vgpr(s32) = COPY $vgpr0
    %2:sgpr(s32) = G_FCONSTANT float 2.000000e+00
    %8:vgpr(s32) = COPY %2(s32)
    %3:vgpr(s32) = G_FMUL %0, %8
    %6:sgpr(s32) = G_FCONSTANT float 1.000000e+00
    %5:sgpr(s32) = G_FCONSTANT float 0.000000e+00
    %9:vgpr(s32) = COPY %5(s32)
    %10:vgpr(s32) = COPY %6(s32)
    %4:vgpr(s32) = G_AMDGPU_FMED3 %3(s32), %9(s32), %10(s32)
    $vgpr0 = COPY %4(s32)
...