84 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -verify-machineinstrs -verify-coalescing -run-pass=register-coalescer -o - %s | FileCheck %s3 4# The copy from %0 to %1 introduces liveness for %3.sub2. After5# coalescing, the use of %1.sub2 needs to be marked undef. The6# subregless copy previously did not consider the existing subregister7# on the use operand.8 9---10name: undef_subreg_use_after_full_copy_coalesce_011tracksRegLiveness: true12body: |13 bb.0:14 ; CHECK-LABEL: name: undef_subreg_use_after_full_copy_coalesce_015 ; CHECK: undef [[V_MOV_B32_e32_:%[0-9]+]].sub0:vreg_96 = V_MOV_B32_e32 0, implicit $exec16 ; CHECK-NEXT: dead [[V_MOV_B32_e32_:%[0-9]+]].sub1:vreg_96 = V_MOV_B32_e32 0, implicit $exec17 ; CHECK-NEXT: S_ENDPGM 0, implicit undef [[V_MOV_B32_e32_]].sub218 undef %0.sub0:vreg_96 = V_MOV_B32_e32 0, implicit $exec19 %0.sub1:vreg_96 = V_MOV_B32_e32 0, implicit $exec20 %1:vreg_96 = COPY killed %021 S_ENDPGM 0, implicit %1.sub222 23...24 25# Same, except coalesced copy has a subregister index that needs to be26# composed with the use index.27---28name: undef_subreg_use_after_full_copy_coalesce_composed29tracksRegLiveness: true30body: |31 bb.0:32 ; CHECK-LABEL: name: undef_subreg_use_after_full_copy_coalesce_composed33 ; CHECK: undef [[V_MOV_B32_e32_:%[0-9]+]].sub0:vreg_128 = V_MOV_B32_e32 0, implicit $exec34 ; CHECK-NEXT: dead [[V_MOV_B32_e32_:%[0-9]+]].sub1:vreg_128 = V_MOV_B32_e32 0, implicit $exec35 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF36 ; CHECK-NEXT: S_ENDPGM 0, implicit [[DEF]].sub137 undef %0.sub0:vreg_128 = V_MOV_B32_e32 0, implicit $exec38 %0.sub1:vreg_128 = V_MOV_B32_e32 0, implicit $exec39 %1:vreg_128 = COPY killed %040 %2:vreg_64 = COPY killed %1.sub2_sub341 S_ENDPGM 0, implicit %2.sub142 43...44 45# FIXME: Initial computed range is wrong for %0.sub2_sub3 and fails46# verifier.47# ---48# name: undef_subreg_use_after_full_copy_coalesce_composed249# tracksRegLiveness: true50# body: |51# bb.0:52# undef %0.sub0:vreg_128 = V_MOV_B32_e32 0, implicit $exec53# %0.sub1:vreg_128 = V_MOV_B32_e32 0, implicit $exec54# %1:vreg_128 = COPY killed %0.sub2_sub355# S_ENDPGM 0, implicit %1.sub156 57# ...58 59---60name: undef_subreg_use_after_full_copy_coalesce_161tracksRegLiveness: true62body: |63 bb.0:64 liveins: $vgpr0, $vgpr1, $vgpr265 66 ; CHECK-LABEL: name: undef_subreg_use_after_full_copy_coalesce_167 ; CHECK: liveins: $vgpr0, $vgpr1, $vgpr268 ; CHECK-NEXT: {{ $}}69 ; CHECK-NEXT: undef [[COPY:%[0-9]+]].sub0:vreg_96 = COPY $vgpr070 ; CHECK-NEXT: [[COPY:%[0-9]+]].sub1:vreg_96 = COPY $vgpr171 ; CHECK-NEXT: S_NOP 0, implicit undef [[COPY]].sub272 ; CHECK-NEXT: S_NOP 0, implicit [[COPY]].sub173 ; CHECK-NEXT: S_ENDPGM 074 %0:vgpr_32 = COPY killed $vgpr075 %1:vgpr_32 = COPY killed $vgpr176 undef %2.sub0:vreg_96 = COPY killed %077 %2.sub1:vreg_96 = COPY killed %178 %3:vreg_96 = COPY killed %279 S_NOP 0, implicit %3.sub280 S_NOP 0, implicit %3.sub181 S_ENDPGM 082 83...84