File: gfx10-twoaddr-fma.mir

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (192 lines) | stat: -rw-r--r-- 7,210 bytes parent folder | download | duplicates (6)
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
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=twoaddressinstruction -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GFX10,GFX10-NOLIS %s
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -passes=two-address-instruction -verify-each -o - %s | FileCheck --check-prefixes=GFX10,GFX10-NOLIS %s
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=liveintervals,twoaddressinstruction -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GFX10,GFX10-LIS %s


# GFX10-LABEL: name: test_fmamk_reg_imm_f16
# GFX10: dead %2:vgpr_32 = IMPLICIT_DEF
# GFX10-NOT: V_MOV_B32
# GFX10-NOLIS: V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
# GFX10-LIS: V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
---
name:            test_fmamk_reg_imm_f16
tracksRegLiveness: true
body:             |
  bb.0:

    %0:vreg_64 = IMPLICIT_DEF
    %1:vgpr_32 = COPY %0.sub1
    %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
    %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec

...

# GFX10-LABEL: name: test_fmamk_reg_imm_f16__imm_is_subreg
# GFX10: %0:vreg_64 = IMPLICIT_DEF
# GFX10: %1:vgpr_32 = COPY %0.sub1
# GFX10: dead undef %2.sub0:vreg_64 = IMPLICIT_DEF
# GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
# GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
---
name:            test_fmamk_reg_imm_f16__imm_is_subreg
tracksRegLiveness: true
body:             |
  bb.0:

    %0:vreg_64 = IMPLICIT_DEF
    %1:vgpr_32 = COPY %0.sub1
    undef %2.sub0:vreg_64 = V_MOV_B32_e32 1078523331, implicit $exec
    %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2.sub0, killed %1, implicit $mode, implicit $exec

...

# GFX10-LABEL: name: test_fmamk_reg_imm_f16__imm_is_subreg_fully_defined
# GFX10: %0:vreg_64 = IMPLICIT_DEF
# GFX10: %1:vgpr_32 = COPY %0.sub1
# GFX10: undef %2.sub1:vreg_64 = V_MOV_B32_e32 9999, implicit $exec
# GFX10: %2.sub0:vreg_64 = V_MOV_B32_e32 1078523331, implicit $exec
# GFX10-NOLIS: %3:vgpr_32 = V_FMA_F16_gfx9_e64 0, killed %0.sub0, 0, %2.sub0, 0, killed %1, 0, 0, 0, implicit $mode, implicit $e
# GFX10-LIS: %3:vgpr_32 = V_FMA_F16_gfx9_e64 0, %0.sub0, 0, %2.sub0, 0, %1, 0, 0, 0, implicit $mode, implicit $e
---
name:            test_fmamk_reg_imm_f16__imm_is_subreg_fully_defined
tracksRegLiveness: true
body:             |
  bb.0:
    %0:vreg_64 = IMPLICIT_DEF
    %1:vgpr_32 = COPY %0.sub1
    undef %2.sub1 = V_MOV_B32_e32 9999, implicit $exec
    %2.sub0:vreg_64 = V_MOV_B32_e32 1078523331, implicit $exec
    %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2.sub0, killed %1, implicit $mode, implicit $exec

...

# GFX10-LABEL: name: test_fmamk_reg_imm_f16__use_imm_before_mac
# GFX10: %0:vreg_64 = IMPLICIT_DEF
# GFX10: %1:vgpr_32 = COPY %0.sub1
# GFX10: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
# GFX10: S_NOP 0, implicit %2
# GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
# GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
---
name:            test_fmamk_reg_imm_f16__use_imm_before_mac
tracksRegLiveness: true
body:             |
  bb.0:

    %0:vreg_64 = IMPLICIT_DEF
    %1:vgpr_32 = COPY %0.sub1
    %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
    S_NOP 0, implicit %2
    %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec

...

# GFX10-LABEL: name: test_fmamk_reg_imm_f16__use_imm_after_mac
# GFX10: %0:vreg_64 = IMPLICIT_DEF
# GFX10: %1:vgpr_32 = COPY %0.sub1
# GFX10: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
# GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
# GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
---
name:            test_fmamk_reg_imm_f16__use_imm_after_mac
tracksRegLiveness: true
body:             |
  bb.0:

    %0:vreg_64 = IMPLICIT_DEF
    %1:vgpr_32 = COPY %0.sub1
    %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
    %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
    S_NOP 0, implicit %2

...

# GFX10-LABEL: name: test_fmamk_reg_imm_f16__use_imm_before_after_mac
# GFX10: %0:vreg_64 = IMPLICIT_DEF
# GFX10: %1:vgpr_32 = COPY %0.sub1
# GFX10: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
# GFX10: S_NOP 0, implicit %2
# GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
# GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
# GFX10: S_NOP 0, implicit %2

---
name:            test_fmamk_reg_imm_f16__use_imm_before_after_mac
tracksRegLiveness: true
body:             |
  bb.0:

    %0:vreg_64 = IMPLICIT_DEF
    %1:vgpr_32 = COPY %0.sub1
    %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
    S_NOP 0, implicit %2
    %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
    S_NOP 0, implicit %2

...

# GFX10-LABEL: name: test_fmamk_imm_reg_f16
# GFX10: dead %2:vgpr_32 = IMPLICIT_DEF
# GFX10-NOT: V_MOV_B32
# GFX10-NOLIS: V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
# GFX10-LIS: V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
---
name:            test_fmamk_imm_reg_f16
tracksRegLiveness: true
registers:
  - { id: 0, class: vreg_64 }
  - { id: 1, class: vgpr_32 }
  - { id: 2, class: vgpr_32 }
  - { id: 3, class: vgpr_32 }
body:             |
  bb.0:

    %0 = IMPLICIT_DEF
    %1 = COPY %0.sub1
    %2 = V_MOV_B32_e32 1078523331, implicit $exec
    %3 = V_FMAC_F16_e32 %2, killed %0.sub0, killed %1, implicit $mode, implicit $exec

...

# GFX10-LABEL: name: test_fmaak_f16
# GFX10: %1:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
# GFX10-NOT: V_MOV_B32
# GFX10-NOLIS: V_FMAAK_F16 killed %0.sub0, %0.sub1, 1078523331, implicit $mode, implicit $exec
# GFX10-LIS: V_FMAAK_F16 %0.sub0, %0.sub1, 1078523331, implicit $mode, implicit $exec
---
name:            test_fmaak_f16
tracksRegLiveness: true
registers:
  - { id: 0, class: vreg_64 }
  - { id: 1, class: vgpr_32 }
  - { id: 2, class: vgpr_32 }
body:             |
  bb.0:

    %0 = IMPLICIT_DEF
    %1 = V_MOV_B32_e32 1078523331, implicit $exec
    %2 = V_FMAC_F16_e32 killed %0.sub0, %0.sub1, %1, implicit $mode, implicit $exec
    S_ENDPGM 0, implicit %1
...

# GFX10-LABEL: name: test_fmaak_inline_literal_f16
# GFX10: %1:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
# GFX10-NOT: V_MOV_B32
# GFX10-NOLIS: %2:vgpr_32 = V_FMAAK_F16 16384, killed %0, 49664, implicit $mode, implicit $exec
# GFX10-LIS: %2:vgpr_32 = V_FMAAK_F16 16384, %0, 49664, implicit $mode, implicit $exec

---
name:            test_fmaak_inline_literal_f16
tracksRegLiveness: true
liveins:
  - { reg: '$vgpr0', virtual-reg: '%0' }
body:             |
  bb.0:
    liveins: $vgpr0

    %0:vgpr_32 = COPY killed $vgpr0

    %1:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
    %2:vgpr_32 = V_FMAC_F16_e32 16384, killed %0, %1, implicit $mode, implicit $exec
    S_ENDPGM 0, implicit %1
...