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 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
|
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass si-fold-operands %s -o - | FileCheck -check-prefix=GCN %s
# GCN-LABEL: name: test_part_fold{{$}}
# GCN: %2:sreg_32 = S_ADD_I32 70, %1
---
name: test_part_fold
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 80
%2:sreg_32 = S_ADD_I32 %0, %1, implicit-def $scc
...
# GCN-LABEL: name: test_inline_const{{$}}
# GCN: %2:sreg_32 = S_ADD_I32 70, 63
---
name: test_inline_const
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 63
%2:sreg_32 = S_ADD_I32 %0, %1, implicit-def $scc
...
# GCN-LABEL: name: test_obscure{{$}}
# GCN: %2:sreg_32 = S_LSHL2_ADD_U32 70, %1
---
name: test_obscure
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 80
%2:sreg_32 = S_LSHL2_ADD_U32 %0, %1, implicit-def $scc
...
# GCN-LABEL: name: test_obscure_inline{{$}}
# GCN: %2:sreg_32 = S_LSHL2_ADD_U32 70, 63
---
name: test_obscure_inline
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 63
%2:sreg_32 = S_LSHL2_ADD_U32 %0, %1, implicit-def $scc
...
# GCN-LABEL: name: test_frameindex{{$}}
# GCN: %1:sreg_32 = S_ADD_I32 %stack.0, 70
---
name: test_frameindex
tracksRegLiveness: true
stack:
- { id: 0, type: default, offset: 0, size: 64, alignment: 16}
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_ADD_I32 %stack.0, %0, implicit-def $scc
...
# GCN-LABEL: name: test_frameindex_inline{{$}}
# GCN: %1:sreg_32 = S_ADD_I32 %stack.0, 63
---
name: test_frameindex_inline
tracksRegLiveness: true
stack:
- { id: 0, type: default, offset: 0, size: 64, alignment: 16}
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 63
%1:sreg_32 = S_ADD_I32 %stack.0, %0, implicit-def $scc
...
# GCN-LABEL: name: test_no_fold_literal_already_inline_lhs{{$}}
# GCN: %0:sreg_32 = S_MOV_B32 80
# GCN-NEXT: %1:sreg_32 = S_ADD_I32 70, %0
---
name: test_no_fold_literal_already_inline_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
%1:sreg_32 = S_ADD_I32 70, %0, implicit-def $scc
...
# GCN-LABEL: name: test_no_fold_literal_already_inline_rhs{{$}}
# GCN: %0:sreg_32 = S_MOV_B32 80
# GCN-NEXT: %1:sreg_32 = S_ADD_I32 %0, 70
---
name: test_no_fold_literal_already_inline_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
%1:sreg_32 = S_ADD_I32 %0, 70, implicit-def $scc
...
# GCN-LABEL: name: test_fold_literal_inlineimm_lhs{{$}}
# GCN: %1:sreg_32 = S_ADD_I32 64, 80
---
name: test_fold_literal_inlineimm_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
%1:sreg_32 = S_ADD_I32 64, %0, implicit-def $scc
...
# GCN-LABEL: name: test_fold_literal_inlineimm_rhs{{$}}
# GCN: %1:sreg_32 = S_ADD_I32 80, 64
---
name: test_fold_literal_inlineimm_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
%1:sreg_32 = S_ADD_I32 %0, 64, implicit-def $scc
...
# GCN-LABEL: name: test_fold_same_literal_2x{{$}}
# GCN: %2:sreg_32 = S_ADD_I32 70, 70
---
name: test_fold_same_literal_2x
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 70
%2:sreg_32 = S_ADD_I32 %0, %1, implicit-def $scc
...
# GCN-LABEL: name: test_fold_same_literal_lhs{{$}}
# GCN: %1:sreg_32 = S_ADD_I32 70, 70
---
name: test_fold_same_literal_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_ADD_I32 70, %0, implicit-def $scc
...
# GCN-LABEL: name: test_fold_same_literal_rhs{{$}}
# GCN: %1:sreg_32 = S_ADD_I32 70, 70
---
name: test_fold_same_literal_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_ADD_I32 %0, 70, implicit-def $scc
...
# GCN-LABEL: name: test_s_cselect_b32_2x_literal_fold{{$}}
# GCN: %2:sreg_32 = S_CSELECT_B32 70, %1, implicit $scc
---
name: test_s_cselect_b32_2x_literal_fold
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 80
$scc = IMPLICIT_DEF
%2:sreg_32 = S_CSELECT_B32 %0, %1, implicit $scc
...
# GCN-LABEL: name: test_s_cselect_b32_fold_literal_literal_lhs{{$}}
# GCN: %1:sreg_32 = S_CSELECT_B32 70, %0, implicit $scc
---
name: test_s_cselect_b32_fold_literal_literal_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
$scc = IMPLICIT_DEF
%1:sreg_32 = S_CSELECT_B32 70, %0, implicit $scc
...
# GCN-LABEL: name: test_s_cselect_b32_fold_literal_literal_rhs{{$}}
# GCN: %1:sreg_32 = S_CSELECT_B32 %0, 70, implicit $scc
---
name: test_s_cselect_b32_fold_literal_literal_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
$scc = IMPLICIT_DEF
%1:sreg_32 = S_CSELECT_B32 %0, 70, implicit $scc
...
# GCN-LABEL: name: test_s_cselect_b32_fold_literal_inlineimm_lhs{{$}}
# GCN: %1:sreg_32 = S_CSELECT_B32 64, 80, implicit $scc
---
name: test_s_cselect_b32_fold_literal_inlineimm_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
$scc = IMPLICIT_DEF
%1:sreg_32 = S_CSELECT_B32 64, %0, implicit $scc
...
# GCN-LABEL: name: test_s_cselect_b32_fold_literal_inlineimm_rhs{{$}}
# GCN: %1:sreg_32 = S_CSELECT_B32 80, 64, implicit $scc
---
name: test_s_cselect_b32_fold_literal_inlineimm_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
$scc = IMPLICIT_DEF
%1:sreg_32 = S_CSELECT_B32 %0, 64, implicit $scc
...
# GCN-LABEL: name: test_s_cmp_b32_2x_literal_fold{{$}}
# GCN: S_CMP_EQ_U32 70, %1, implicit-def $scc
---
name: test_s_cmp_b32_2x_literal_fold
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 70
%1:sreg_32 = S_MOV_B32 80
$scc = IMPLICIT_DEF
S_CMP_EQ_U32 %0, %1, implicit-def $scc
...
# GCN-LABEL: name: test_s_cmp_b32_literal_literal_lhs{{$}}
# GCN: S_CMP_EQ_U32 70, %0, implicit-def $scc
---
name: test_s_cmp_b32_literal_literal_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
S_CMP_EQ_U32 70, %0, implicit-def $scc
...
# GCN-LABEL: name: test_s_cmp_b32_literal_literal_rhs{{$}}
# GCN: S_CMP_EQ_U32 %0, 70, implicit-def $scc
---
name: test_s_cmp_b32_literal_literal_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
S_CMP_EQ_U32 %0, 70, implicit-def $scc
...
# GCN-LABEL: name: test_s_cmp_b32_literal_inlineimm_lhs{{$}}
# GCN: S_CMP_EQ_U32 64, 80, implicit-def $scc
---
name: test_s_cmp_b32_literal_inlineimm_lhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
S_CMP_EQ_U32 64, %0, implicit-def $scc
...
# GCN-LABEL: name: test_s_cmp_b32_literal_inlineimm_rhs{{$}}
# GCN: S_CMP_EQ_U32 80, 64, implicit-def $scc
---
name: test_s_cmp_b32_literal_inlineimm_rhs
tracksRegLiveness: true
body: |
bb.0:
%0:sreg_32 = S_MOV_B32 80
S_CMP_EQ_U32 %0, 64, implicit-def $scc
...
# Ignore regmask operands
# GCN-LABEL: name: test_si_cs_chain_fold_with_regmask{{$}}
# GCN: SI_CS_CHAIN_TC_W32 %0, 0, 0, 1234, amdgpu_allvgprs, implicit $sgpr0, implicit $vgpr8
---
name: test_si_cs_chain_fold_with_regmask
tracksRegLiveness: true
body: |
bb.0:
liveins: $sgpr0, $sgpr2_sgpr3, $vgpr8
%1:ccr_sgpr_64 = COPY $sgpr2_sgpr3
%2:sreg_32 = S_MOV_B32 1234
SI_CS_CHAIN_TC_W32 %1:ccr_sgpr_64, 0, 0, %2:sreg_32, amdgpu_allvgprs, implicit $sgpr0, implicit $vgpr8
...
|