1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -run-pass=register-coalescer -verify-coalescing -o - %s | FileCheck %s
4 # Test that an invalid subreg range is not introduced due to the undef
5 # %1.sub0 use. An undef use with a subregister index would end up
6 # introducing subranges for the empty and full lanemasks.
9 name: merge_with_undef_subreg_use_subrange_lanemask_is_invalid
10 tracksRegLiveness: true
13 scratchRSrcReg: '$sgpr96_sgpr97_sgpr98_sgpr99'
14 stackPtrOffsetReg: '$sgpr32'
15 sgprForEXECCopy: '$sgpr100_sgpr101'
17 ; CHECK-LABEL: name: merge_with_undef_subreg_use_subrange_lanemask_is_invalid
19 ; CHECK-NEXT: successors: %bb.1(0x80000000)
20 ; CHECK-NEXT: liveins: $sgpr8_sgpr9
22 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64 = COPY $sgpr8_sgpr9
23 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]]:sgpr_128 = S_LOAD_DWORDX4_IMM [[COPY]], 0, 0 :: (load (s128), addrspace 4)
26 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.2(0x40000000)
28 ; CHECK-NEXT: S_CBRANCH_VCCNZ %bb.3, implicit undef $vcc
29 ; CHECK-NEXT: S_BRANCH %bb.2
32 ; CHECK-NEXT: successors: %bb.3(0x80000000)
34 ; CHECK-NEXT: undef [[S_LOAD_DWORDX4_IMM:%[0-9]+]].sub0:sgpr_128 = S_MOV_B32 0
37 ; CHECK-NEXT: [[S_LOAD_DWORDX4_IMM:%[0-9]+]].sub1:sgpr_128 = COPY undef [[S_LOAD_DWORDX4_IMM]].sub0
38 ; CHECK-NEXT: S_ENDPGM 0, implicit [[S_LOAD_DWORDX4_IMM]]
42 %0:sgpr_64 = COPY $sgpr8_sgpr9
43 %1:sgpr_128 = S_LOAD_DWORDX4_IMM %0, 0, 0 :: (load (s128), addrspace 4)
47 S_CBRANCH_VCCNZ %bb.3, implicit undef $vcc
51 undef %3.sub0:sgpr_128 = S_MOV_B32 0
52 %2:sgpr_128 = COPY killed %3
55 %4:sgpr_128 = COPY killed %2
56 %4.sub1:sgpr_128 = COPY undef %1.sub0
57 S_ENDPGM 0, implicit %4