1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-coalescing -run-pass=simple-register-coalescing -verify-machineinstrs -o - %s | FileCheck %s
4 # Bug 39602: Avoid "Couldn't join subrange" error when clearing valid
5 # lanes on an implicit_def that later cannot be erased.
8 name: lost_valid_lanes_maybe_erasable_implicit_def
9 tracksRegLiveness: true
11 ; CHECK-LABEL: name: lost_valid_lanes_maybe_erasable_implicit_def
13 ; CHECK: successors: %bb.1(0x80000000)
14 ; CHECK: undef %0.sub1:sreg_64 = IMPLICIT_DEF
16 ; CHECK: %0.sub0:sreg_64 = S_MOV_B32 0
17 ; CHECK: [[COPY:%[0-9]+]]:sreg_64 = COPY %0
18 ; CHECK: dead %0.sub1:sreg_64 = COPY %0.sub0
19 ; CHECK: S_ENDPGM 0, implicit [[COPY]].sub1
22 undef %0.sub1:sreg_64 = IMPLICIT_DEF
25 %0.sub0:sreg_64 = S_MOV_B32 0
26 %1:sreg_64 = COPY %0:sreg_64
27 dead %0.sub1:sreg_64 = COPY %0.sub0:sreg_64
28 S_ENDPGM 0, implicit %1.sub1:sreg_64
32 # Same as previous, except with a real value instead of
33 # IMPLICIT_DEF. These should both be handled the same way.
35 name: lost_valid_lanes_real_value
36 tracksRegLiveness: true
38 ; CHECK-LABEL: name: lost_valid_lanes_real_value
40 ; CHECK: successors: %bb.1(0x80000000)
41 ; CHECK: undef %0.sub1:sreg_64 = S_MOV_B32 -1
43 ; CHECK: %0.sub0:sreg_64 = S_MOV_B32 0
44 ; CHECK: [[COPY:%[0-9]+]]:sreg_64 = COPY %0
45 ; CHECK: dead %0.sub1:sreg_64 = COPY %0.sub0
46 ; CHECK: S_ENDPGM 0, implicit [[COPY]].sub1
49 undef %0.sub1:sreg_64 = S_MOV_B32 -1
52 %0.sub0:sreg_64 = S_MOV_B32 0
53 %1:sreg_64 = COPY %0:sreg_64
54 dead %0.sub1:sreg_64 = COPY %0.sub0:sreg_64
55 S_ENDPGM 0, implicit %1.sub1:sreg_64