combine-add-to-ptradd.mir
5.74 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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
---
name: add_ptrtoint_p1_to_s64_lhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN-LABEL: name: add_ptrtoint_p1_to_s64_lhs
; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
; GCN: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
; GCN: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
; GCN: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[PTR_ADD]](p1)
; GCN: $vgpr0_vgpr1 = COPY [[PTRTOINT]](s64)
%0:_(p1) = COPY $vgpr0_vgpr1
%1:_(s64) = COPY $vgpr2_vgpr3
%2:_(s64) = G_PTRTOINT %0
%3:_(s64) = G_ADD %2, %1
$vgpr0_vgpr1 = COPY %3
...
---
name: add_ptrtoint_p1_to_s32_lhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1, $vgpr2
; GCN-LABEL: name: add_ptrtoint_p1_to_s32_lhs
; GCN: liveins: $vgpr0_vgpr1, $vgpr2
; GCN: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
; GCN: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
; GCN: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p1)
; GCN: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[PTRTOINT]], [[COPY1]]
; GCN: $vgpr0 = COPY [[ADD]](s32)
%0:_(p1) = COPY $vgpr0_vgpr1
%1:_(s32) = COPY $vgpr2
%2:_(s32) = G_PTRTOINT %0
%3:_(s32) = G_ADD %2, %1
$vgpr0 = COPY %3
...
---
name: add_ptrtoint_p3_to_s32_lhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $vgpr1
; GCN-LABEL: name: add_ptrtoint_p3_to_s32_lhs
; GCN: liveins: $vgpr0, $vgpr1
; GCN: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
; GCN: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
; GCN: [[PTR_ADD:%[0-9]+]]:_(p3) = G_PTR_ADD [[COPY]], [[COPY1]](s32)
; GCN: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[PTR_ADD]](p3)
; GCN: $vgpr0 = COPY [[PTRTOINT]](s32)
%0:_(p3) = COPY $vgpr0
%1:_(s32) = COPY $vgpr1
%2:_(s32) = G_PTRTOINT %0
%3:_(s32) = G_ADD %2, %1
$vgpr0 = COPY %3
...
---
name: inttoptr_add_ptrtoint_p1_to_s64_lhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN-LABEL: name: inttoptr_add_ptrtoint_p1_to_s64_lhs
; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
; GCN: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
; GCN: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
; GCN: $vgpr0_vgpr1 = COPY [[PTR_ADD]](p1)
%0:_(p1) = COPY $vgpr0_vgpr1
%1:_(s64) = COPY $vgpr2_vgpr3
%2:_(s64) = G_PTRTOINT %0
%3:_(s64) = G_ADD %2, %1
%4:_(p1) = G_INTTOPTR %3
$vgpr0_vgpr1 = COPY %4
...
---
name: add_ptrtoint_v2p3_to_v2s32_lhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN-LABEL: name: add_ptrtoint_v2p3_to_v2s32_lhs
; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
; GCN: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
; GCN: [[PTR_ADD:%[0-9]+]]:_(<2 x p3>) = G_PTR_ADD [[COPY]], [[COPY1]](<2 x s32>)
; GCN: [[PTRTOINT:%[0-9]+]]:_(<2 x s32>) = G_PTRTOINT [[PTR_ADD]](<2 x p3>)
; GCN: $vgpr0_vgpr1 = COPY [[PTRTOINT]](<2 x s32>)
%0:_(<2 x p3>) = COPY $vgpr0_vgpr1
%1:_(<2 x s32>) = COPY $vgpr2_vgpr3
%2:_(<2 x s32>) = G_PTRTOINT %0
%3:_(<2 x s32>) = G_ADD %2, %1
$vgpr0_vgpr1 = COPY %3
...
---
name: add_ptrtoint_v2p1_to_v2s32_lhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5
; GCN-LABEL: name: add_ptrtoint_v2p1_to_v2s32_lhs
; GCN: liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5
; GCN: [[COPY:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
; GCN: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
; GCN: [[PTRTOINT:%[0-9]+]]:_(<2 x s32>) = G_PTRTOINT [[COPY]](<2 x p1>)
; GCN: [[ADD:%[0-9]+]]:_(<2 x s32>) = G_ADD [[PTRTOINT]], [[COPY1]]
; GCN: $vgpr0_vgpr1 = COPY [[ADD]](<2 x s32>)
%0:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
%1:_(<2 x s32>) = COPY $vgpr4_vgpr5
%2:_(<2 x s32>) = G_PTRTOINT %0
%3:_(<2 x s32>) = G_ADD %2, %1
$vgpr0_vgpr1 = COPY %3
...
---
name: add_ptrtoint_p1_to_s64_rhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN-LABEL: name: add_ptrtoint_p1_to_s64_rhs
; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
; GCN: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
; GCN: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
; GCN: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[PTR_ADD]](p1)
; GCN: $vgpr0_vgpr1 = COPY [[PTRTOINT]](s64)
%0:_(p1) = COPY $vgpr0_vgpr1
%1:_(s64) = COPY $vgpr2_vgpr3
%2:_(s64) = G_PTRTOINT %0
%3:_(s64) = G_ADD %1, %2
$vgpr0_vgpr1 = COPY %3
...
---
name: add_ptrtoint_p1_to_s64_lhs_rhs
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN-LABEL: name: add_ptrtoint_p1_to_s64_lhs_rhs
; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
; GCN: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
; GCN: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
; GCN: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[COPY1]](p1)
; GCN: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[PTRTOINT]](s64)
; GCN: [[PTRTOINT1:%[0-9]+]]:_(s64) = G_PTRTOINT [[PTR_ADD]](p1)
; GCN: $vgpr0_vgpr1 = COPY [[PTRTOINT1]](s64)
%0:_(p1) = COPY $vgpr0_vgpr1
%1:_(p1) = COPY $vgpr2_vgpr3
%2:_(s64) = G_PTRTOINT %0
%3:_(s64) = G_PTRTOINT %1
%4:_(s64) = G_ADD %2, %3
$vgpr0_vgpr1 = COPY %4
...