357 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck -check-prefix=GCN %s3 4---5 6name: sext_inreg_sgpr_s32_17legalized: true8regBankSelected: true9body: |10 bb.0:11 liveins: $sgpr012 13 ; GCN-LABEL: name: sext_inreg_sgpr_s32_114 ; GCN: liveins: $sgpr015 ; GCN-NEXT: {{ $}}16 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr017 ; GCN-NEXT: [[S_BFE_I32_:%[0-9]+]]:sreg_32 = S_BFE_I32 [[COPY]], 65536, implicit-def $scc18 ; GCN-NEXT: $sgpr0 = COPY [[S_BFE_I32_]]19 %0:sgpr(s32) = COPY $sgpr020 %1:sgpr(s32) = G_SEXT_INREG %0, 121 $sgpr0 = COPY %122...23 24---25 26name: sext_inreg_sgpr_s32_227legalized: true28regBankSelected: true29body: |30 bb.0:31 liveins: $sgpr032 33 ; GCN-LABEL: name: sext_inreg_sgpr_s32_234 ; GCN: liveins: $sgpr035 ; GCN-NEXT: {{ $}}36 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr037 ; GCN-NEXT: [[S_BFE_I32_:%[0-9]+]]:sreg_32 = S_BFE_I32 [[COPY]], 131072, implicit-def $scc38 ; GCN-NEXT: $sgpr0 = COPY [[S_BFE_I32_]]39 %0:sgpr(s32) = COPY $sgpr040 %1:sgpr(s32) = G_SEXT_INREG %0, 241 $sgpr0 = COPY %142...43 44---45 46name: sext_inreg_sgpr_s32_847legalized: true48regBankSelected: true49body: |50 bb.0:51 liveins: $sgpr052 53 ; GCN-LABEL: name: sext_inreg_sgpr_s32_854 ; GCN: liveins: $sgpr055 ; GCN-NEXT: {{ $}}56 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr057 ; GCN-NEXT: [[S_SEXT_I32_I8_:%[0-9]+]]:sreg_32 = S_SEXT_I32_I8 [[COPY]]58 ; GCN-NEXT: $sgpr0 = COPY [[S_SEXT_I32_I8_]]59 %0:sgpr(s32) = COPY $sgpr060 %1:sgpr(s32) = G_SEXT_INREG %0, 861 $sgpr0 = COPY %162...63 64---65 66name: sext_inreg_sgpr_s32_1667legalized: true68regBankSelected: true69body: |70 bb.0:71 liveins: $sgpr072 73 ; GCN-LABEL: name: sext_inreg_sgpr_s32_1674 ; GCN: liveins: $sgpr075 ; GCN-NEXT: {{ $}}76 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr077 ; GCN-NEXT: [[S_SEXT_I32_I16_:%[0-9]+]]:sreg_32 = S_SEXT_I32_I16 [[COPY]]78 ; GCN-NEXT: $sgpr0 = COPY [[S_SEXT_I32_I16_]]79 %0:sgpr(s32) = COPY $sgpr080 %1:sgpr(s32) = G_SEXT_INREG %0, 1681 $sgpr0 = COPY %182...83 84---85 86name: sext_inreg_sgpr_s32_3187legalized: true88regBankSelected: true89body: |90 bb.0:91 liveins: $sgpr092 93 ; GCN-LABEL: name: sext_inreg_sgpr_s32_3194 ; GCN: liveins: $sgpr095 ; GCN-NEXT: {{ $}}96 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr097 ; GCN-NEXT: [[S_BFE_I32_:%[0-9]+]]:sreg_32 = S_BFE_I32 [[COPY]], 2031616, implicit-def $scc98 ; GCN-NEXT: $sgpr0 = COPY [[S_BFE_I32_]]99 %0:sgpr(s32) = COPY $sgpr0100 %1:sgpr(s32) = G_SEXT_INREG %0, 31101 $sgpr0 = COPY %1102...103 104---105 106name: sext_inreg_sgpr_s64_1107legalized: true108regBankSelected: true109body: |110 bb.0:111 liveins: $sgpr0_sgpr1112 113 ; GCN-LABEL: name: sext_inreg_sgpr_s64_1114 ; GCN: liveins: $sgpr0_sgpr1115 ; GCN-NEXT: {{ $}}116 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1117 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF118 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[DEF]], %subreg.sub1119 ; GCN-NEXT: [[S_BFE_I64_:%[0-9]+]]:sreg_64 = S_BFE_I64 [[REG_SEQUENCE]], 65536, implicit-def $scc120 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]121 %0:sgpr(s64) = COPY $sgpr0_sgpr1122 %1:sgpr(s64) = G_SEXT_INREG %0, 1123 $sgpr0_sgpr1 = COPY %1124...125 126---127 128name: sext_inreg_sgpr_s64_2129legalized: true130regBankSelected: true131body: |132 bb.0:133 liveins: $sgpr0_sgpr1134 135 ; GCN-LABEL: name: sext_inreg_sgpr_s64_2136 ; GCN: liveins: $sgpr0_sgpr1137 ; GCN-NEXT: {{ $}}138 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1139 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF140 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[DEF]], %subreg.sub1141 ; GCN-NEXT: [[S_BFE_I64_:%[0-9]+]]:sreg_64 = S_BFE_I64 [[REG_SEQUENCE]], 131072, implicit-def $scc142 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]143 %0:sgpr(s64) = COPY $sgpr0_sgpr1144 %1:sgpr(s64) = G_SEXT_INREG %0, 2145 $sgpr0_sgpr1 = COPY %1146...147 148---149 150name: sext_inreg_sgpr_s64_8151legalized: true152regBankSelected: true153body: |154 bb.0:155 liveins: $sgpr0_sgpr1156 157 ; GCN-LABEL: name: sext_inreg_sgpr_s64_8158 ; GCN: liveins: $sgpr0_sgpr1159 ; GCN-NEXT: {{ $}}160 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1161 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF162 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[DEF]], %subreg.sub1163 ; GCN-NEXT: [[S_BFE_I64_:%[0-9]+]]:sreg_64 = S_BFE_I64 [[REG_SEQUENCE]], 524288, implicit-def $scc164 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]165 %0:sgpr(s64) = COPY $sgpr0_sgpr1166 %1:sgpr(s64) = G_SEXT_INREG %0, 8167 $sgpr0_sgpr1 = COPY %1168...169 170---171 172name: sext_inreg_sgpr_s64_16173legalized: true174regBankSelected: true175body: |176 bb.0:177 liveins: $sgpr0_sgpr1178 179 ; GCN-LABEL: name: sext_inreg_sgpr_s64_16180 ; GCN: liveins: $sgpr0_sgpr1181 ; GCN-NEXT: {{ $}}182 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1183 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF184 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[DEF]], %subreg.sub1185 ; GCN-NEXT: [[S_BFE_I64_:%[0-9]+]]:sreg_64 = S_BFE_I64 [[REG_SEQUENCE]], 1048576, implicit-def $scc186 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]187 %0:sgpr(s64) = COPY $sgpr0_sgpr1188 %1:sgpr(s64) = G_SEXT_INREG %0, 16189 $sgpr0_sgpr1 = COPY %1190...191 192---193 194name: sext_inreg_sgpr_s64_31195legalized: true196regBankSelected: true197body: |198 bb.0:199 liveins: $sgpr0_sgpr1200 201 ; GCN-LABEL: name: sext_inreg_sgpr_s64_31202 ; GCN: liveins: $sgpr0_sgpr1203 ; GCN-NEXT: {{ $}}204 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1205 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF206 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[DEF]], %subreg.sub1207 ; GCN-NEXT: [[S_BFE_I64_:%[0-9]+]]:sreg_64 = S_BFE_I64 [[REG_SEQUENCE]], 2031616, implicit-def $scc208 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]209 %0:sgpr(s64) = COPY $sgpr0_sgpr1210 %1:sgpr(s64) = G_SEXT_INREG %0, 31211 $sgpr0_sgpr1 = COPY %1212...213 214# Ideally this degenerate case would have been replaceed with a 32-bit shift by combines.215---216 217name: sext_inreg_sgpr_s64_32218legalized: true219regBankSelected: true220body: |221 bb.0:222 liveins: $sgpr0_sgpr1223 224 ; GCN-LABEL: name: sext_inreg_sgpr_s64_32225 ; GCN: liveins: $sgpr0_sgpr1226 ; GCN-NEXT: {{ $}}227 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1228 ; GCN-NEXT: [[S_ASHR_I32_:%[0-9]+]]:sreg_32 = S_ASHR_I32 [[COPY]].sub0, 31, implicit-def dead $scc229 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[S_ASHR_I32_]], %subreg.sub1230 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[REG_SEQUENCE]]231 %0:sgpr(s64) = COPY $sgpr0_sgpr1232 %1:sgpr(s64) = G_SEXT_INREG %0, 32233 $sgpr0_sgpr1 = COPY %1234...235 236---237 238name: sext_inreg_sgpr_s64_63239legalized: true240regBankSelected: true241body: |242 bb.0:243 liveins: $sgpr0_sgpr1244 245 ; GCN-LABEL: name: sext_inreg_sgpr_s64_63246 ; GCN: liveins: $sgpr0_sgpr1247 ; GCN-NEXT: {{ $}}248 ; GCN-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1249 ; GCN-NEXT: [[DEF:%[0-9]+]]:sreg_32 = IMPLICIT_DEF250 ; GCN-NEXT: [[REG_SEQUENCE:%[0-9]+]]:sreg_64 = REG_SEQUENCE [[COPY]].sub0, %subreg.sub0, [[DEF]], %subreg.sub1251 ; GCN-NEXT: [[S_BFE_I64_:%[0-9]+]]:sreg_64 = S_BFE_I64 [[REG_SEQUENCE]], 4128768, implicit-def $scc252 ; GCN-NEXT: $sgpr0_sgpr1 = COPY [[S_BFE_I64_]]253 %0:sgpr(s64) = COPY $sgpr0_sgpr1254 %1:sgpr(s64) = G_SEXT_INREG %0, 63255 $sgpr0_sgpr1 = COPY %1256...257 258---259 260name: sext_inreg_vgpr_s32_1261legalized: true262regBankSelected: true263body: |264 bb.0:265 liveins: $vgpr0266 267 ; GCN-LABEL: name: sext_inreg_vgpr_s32_1268 ; GCN: liveins: $vgpr0269 ; GCN-NEXT: {{ $}}270 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0271 ; GCN-NEXT: [[V_BFE_I32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_I32_e64 [[COPY]], 0, 1, implicit $exec272 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_I32_e64_]]273 %0:vgpr(s32) = COPY $vgpr0274 %1:vgpr(s32) = G_SEXT_INREG %0, 1275 $vgpr0 = COPY %1276...277 278---279 280name: sext_inreg_vgpr_s32_2281legalized: true282regBankSelected: true283body: |284 bb.0:285 liveins: $vgpr0286 287 ; GCN-LABEL: name: sext_inreg_vgpr_s32_2288 ; GCN: liveins: $vgpr0289 ; GCN-NEXT: {{ $}}290 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0291 ; GCN-NEXT: [[V_BFE_I32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_I32_e64 [[COPY]], 0, 2, implicit $exec292 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_I32_e64_]]293 %0:vgpr(s32) = COPY $vgpr0294 %1:vgpr(s32) = G_SEXT_INREG %0, 2295 $vgpr0 = COPY %1296...297 298---299 300name: sext_inreg_vgpr_s32_8301legalized: true302regBankSelected: true303body: |304 bb.0:305 liveins: $vgpr0306 307 ; GCN-LABEL: name: sext_inreg_vgpr_s32_8308 ; GCN: liveins: $vgpr0309 ; GCN-NEXT: {{ $}}310 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0311 ; GCN-NEXT: [[V_BFE_I32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_I32_e64 [[COPY]], 0, 8, implicit $exec312 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_I32_e64_]]313 %0:vgpr(s32) = COPY $vgpr0314 %1:vgpr(s32) = G_SEXT_INREG %0, 8315 $vgpr0 = COPY %1316...317 318---319 320name: sext_inreg_vgpr_s32_16321legalized: true322regBankSelected: true323body: |324 bb.0:325 liveins: $vgpr0326 327 ; GCN-LABEL: name: sext_inreg_vgpr_s32_16328 ; GCN: liveins: $vgpr0329 ; GCN-NEXT: {{ $}}330 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0331 ; GCN-NEXT: [[V_BFE_I32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_I32_e64 [[COPY]], 0, 16, implicit $exec332 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_I32_e64_]]333 %0:vgpr(s32) = COPY $vgpr0334 %1:vgpr(s32) = G_SEXT_INREG %0, 16335 $vgpr0 = COPY %1336...337 338---339 340name: sext_inreg_vgpr_s32_31341legalized: true342regBankSelected: true343body: |344 bb.0:345 liveins: $vgpr0346 347 ; GCN-LABEL: name: sext_inreg_vgpr_s32_31348 ; GCN: liveins: $vgpr0349 ; GCN-NEXT: {{ $}}350 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0351 ; GCN-NEXT: [[V_BFE_I32_e64_:%[0-9]+]]:vgpr_32 = V_BFE_I32_e64 [[COPY]], 0, 31, implicit $exec352 ; GCN-NEXT: $vgpr0 = COPY [[V_BFE_I32_e64_]]353 %0:vgpr(s32) = COPY $vgpr0354 %1:vgpr(s32) = G_SEXT_INREG %0, 31355 $vgpr0 = COPY %1356...357