|
| 1 | +# RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -run-pass=none -filetype=null %s 2>&1 | FileCheck %s |
| 2 | + |
| 3 | +# sub16_sub17_sub18_sub19 is outside the bounds of a 512-bit |
| 4 | +# register. Make sure the verification doesn't assert. This was only |
| 5 | +# broken for targets that require even aligned VGPRs due to the manual |
| 6 | +# alignment check. |
| 7 | + |
| 8 | +--- |
| 9 | +name: uses_invalid_subregister_for_regclass |
| 10 | +tracksRegLiveness: true |
| 11 | +body: | |
| 12 | + bb.0: |
| 13 | + %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec |
| 14 | + S_NOP 0, implicit-def %1:vreg_512_align2 |
| 15 | +
|
| 16 | +
|
| 17 | + ; CHECK: *** Bad machine code: Invalid subregister index for virtual register *** |
| 18 | + ; CHECK-NEXT: - function: uses_invalid_subregister_for_regclass |
| 19 | + ; CHECK-NEXT: - basic block: %bb.0 |
| 20 | + ; CHECK-NEXT: - instruction: GLOBAL_STORE_DWORDX4_SADDR %0:vgpr_32, %1.sub16_sub17_sub18_sub19:vreg_512_align2, undef $sgpr8_sgpr9, 80, 0, implicit $exec :: (store (s128), addrspace 1) |
| 21 | + ; CHECK-NEXT: - operand 1: %1.sub16_sub17_sub18_sub19:vreg_512_align2 |
| 22 | + ; CHECK-NEXT: Register class VReg_512_Align2 does not support subreg index 166 |
| 23 | +
|
| 24 | + ; CHECK: *** Bad machine code: Subtarget requires even aligned vector registers *** |
| 25 | + ; CHECK-NEXT: - function: uses_invalid_subregister_for_regclass |
| 26 | + ; CHECK-NEXT: - basic block: %bb.0 |
| 27 | + ; CHECK-NEXT: - instruction: GLOBAL_STORE_DWORDX4_SADDR %0:vgpr_32, %2.sub16_sub17_sub18_sub19:vreg_512, undef $sgpr8_sgpr9, 80, 0, implicit $exec :: (store (s128), addrspace 1) |
| 28 | + GLOBAL_STORE_DWORDX4_SADDR %0, %1.sub16_sub17_sub18_sub19, undef $sgpr8_sgpr9, 80, 0, implicit $exec :: (store (s128), addrspace 1) |
| 29 | +
|
| 30 | + ; Test with unaligned class |
| 31 | + ; CHECK: *** Bad machine code: Invalid subregister index for virtual register *** |
| 32 | + ; CHECK-NEXT: - function: uses_invalid_subregister_for_regclass |
| 33 | + ; CHECK-NEXT: - basic block: %bb.0 |
| 34 | + ; CHECK-NEXT: - instruction: GLOBAL_STORE_DWORDX4_SADDR %0:vgpr_32, %2.sub16_sub17_sub18_sub19:vreg_512, undef $sgpr8_sgpr9, 80, 0, implicit $exec :: (store (s128), addrspace 1) |
| 35 | + ; CHECK-NEXT: - operand 1: %2.sub16_sub17_sub18_sub19:vreg_512 |
| 36 | + ; CHECK-NEXT: Register class VReg_512 does not support subreg index 166 |
| 37 | + S_NOP 0, implicit-def %2:vreg_512 |
| 38 | + GLOBAL_STORE_DWORDX4_SADDR %0, %2.sub16_sub17_sub18_sub19, undef $sgpr8_sgpr9, 80, 0, implicit $exec :: (store (s128), addrspace 1) |
| 39 | + S_ENDPGM 0 |
| 40 | +
|
| 41 | +... |
0 commit comments