lo16-hi16-physreg-copy.mir
5.35 KB
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
# RUN: llc -march=amdgcn -mcpu=gfx802 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
# RUN: llc -march=amdgcn -mcpu=gfx900 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
# RUN: llc -march=amdgcn -mcpu=gfx1010 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN,GFX10 %s
# GCN-LABEL: {{^}}lo_to_lo:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
name: lo_to_lo
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr1_lo16 = COPY $vgpr0_lo16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_hi:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
name: lo_to_hi
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr1_hi16 = COPY killed $vgpr0_lo16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}hi_to_lo:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
name: hi_to_lo
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr1_lo16 = COPY $vgpr0_hi16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}hi_to_hi:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
name: hi_to_hi
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr1_hi16 = COPY $vgpr0_hi16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_lo_samereg:
# GCN: s_waitcnt
# GFX10-NEXT: s_waitcnt_vscnt
# GCN-NEXT: s_endpgm
name: lo_to_lo_samereg
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr0_lo16 = COPY $vgpr0_lo16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_hi_samereg:
# GCN: v_mov_b32_sdwa v0, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
name: lo_to_hi_samereg
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr0_hi16 = COPY $vgpr0_lo16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}hi_to_lo_samereg:
# GCN: v_mov_b32_sdwa v0, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
name: hi_to_lo_samereg
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr0_lo16 = COPY killed $vgpr0_hi16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}hi_to_hi_samereg:
# GCN: s_waitcnt
# GFX10-NEXT: s_waitcnt_vscnt
# GCN-NEXT: s_endpgm
name: hi_to_hi_samereg
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr0_hi16 = COPY killed $vgpr0_hi16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_lo_def_livein:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
name: lo_to_lo_def_livein
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0
$vgpr1 = IMPLICIT_DEF
$vgpr1_lo16 = COPY $vgpr0_lo16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_hi_def_livein:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
name: lo_to_hi_def_livein
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0
$vgpr1 = IMPLICIT_DEF
$vgpr1_hi16 = COPY $vgpr0_lo16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}hi_to_lo_def_livein:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
name: hi_to_lo_def_livein
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0
$vgpr1 = IMPLICIT_DEF
$vgpr1_lo16 = COPY killed $vgpr0_hi16
S_ENDPGM 0
...
# GCN-LABEL: {{^}}hi_to_hi_def_livein:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
name: hi_to_hi_def_livein
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0
$vgpr1 = IMPLICIT_DEF
$vgpr1_hi16 = COPY $vgpr0_hi16
S_ENDPGM 0
...
# TODO: This can be coalesced into a VGPR_32 copy
# GCN-LABEL: {{^}}lo_to_lo_hi_to_hi:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
# GCN-NEXT: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
# GCN-NEXT: v_mov_b32_e32 v2, v1
# GCN-NEXT: s_endpgm
name: lo_to_lo_hi_to_hi
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr1_lo16 = COPY $vgpr0_lo16
$vgpr1_hi16 = COPY $vgpr0_hi16
$vgpr2 = COPY killed $vgpr1
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_hi_hi_to_lo:
# GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
# GCN-NEXT: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
# GCN-NEXT: v_mov_b32_e32 v2, v1
# GCN-NEXT: s_endpgm
name: lo_to_hi_hi_to_lo
tracksRegLiveness: true
body: |
bb.0:
$vgpr0 = IMPLICIT_DEF
$vgpr1_lo16 = COPY $vgpr0_hi16
$vgpr1_hi16 = COPY $vgpr0_lo16
$vgpr2 = COPY killed $vgpr1
S_ENDPGM 0
...
# NB: copy of undef just killed instead of expansion
# GCN-LABEL: {{^}}lo_to_lo_undef:
# GCN: s_waitcnt
# GFX10-NEXT: s_waitcnt_vscnt
# GCN-NEXT: v_mov_b32_e32 v2, v1
# GCN-NEXT: s_endpgm
name: lo_to_lo_undef
tracksRegLiveness: true
body: |
bb.0:
$vgpr1_lo16 = COPY undef $vgpr0_lo16
$vgpr2 = COPY killed $vgpr1
S_ENDPGM 0
...
# GCN-LABEL: {{^}}lo_to_lo_sgpr_to_sgpr:
# GCN: s_mov_b32 s1, s0
name: lo_to_lo_sgpr_to_sgpr
tracksRegLiveness: true
body: |
bb.0:
$sgpr0 = IMPLICIT_DEF
$sgpr1_lo16 = COPY $sgpr0_lo16
S_ENDPGM 0
...