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-NEXT: successors: %bb.1(0x80000000)
15 ; CHECK-NEXT: undef %0.sub1:sreg_64 = IMPLICIT_DEF
18 ; CHECK-NEXT: %0.sub0:sreg_64 = S_MOV_B32 0
19 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY %0
20 ; CHECK-NEXT: dead %0.sub1:sreg_64 = COPY %0.sub0
21 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]].sub1
24 undef %0.sub1:sreg_64 = IMPLICIT_DEF
27 %0.sub0:sreg_64 = S_MOV_B32 0
28 %1:sreg_64 = COPY %0:sreg_64
29 dead %0.sub1:sreg_64 = COPY %0.sub0:sreg_64
30 S_ENDPGM 0, implicit %1.sub1:sreg_64
34 # Same as previous, except with a real value instead of
35 # IMPLICIT_DEF. These should both be handled the same way.
37 name: lost_valid_lanes_real_value
38 tracksRegLiveness: true
40 ; CHECK-LABEL: name: lost_valid_lanes_real_value
42 ; CHECK-NEXT: successors: %bb.1(0x80000000)
44 ; CHECK-NEXT: undef %0.sub1:sreg_64 = S_MOV_B32 -1
47 ; CHECK-NEXT: %0.sub0:sreg_64 = S_MOV_B32 0
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY %0
49 ; CHECK-NEXT: dead %0.sub1:sreg_64 = COPY %0.sub0
50 ; CHECK-NEXT: S_ENDPGM 0, implicit [[COPY]].sub1
53 undef %0.sub1:sreg_64 = S_MOV_B32 -1
56 %0.sub0:sreg_64 = S_MOV_B32 0
57 %1:sreg_64 = COPY %0:sreg_64
58 dead %0.sub1:sreg_64 = COPY %0.sub0:sreg_64
59 S_ENDPGM 0, implicit %1.sub1:sreg_64