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=gfx900 -run-pass=register-coalescer -verify-coalescing -o - %s | FileCheck %s
4 # Make sure that the undef flag is set on %0 after the IMPLICIT_DEF is
5 # deleted when coalescing %0 with %1
9 tracksRegLiveness: true
11 stackPtrOffsetReg: '$sgpr32'
14 ; CHECK-LABEL: name: test
15 ; CHECK: [[S_BUFFER_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec = S_BUFFER_LOAD_DWORDX2_IMM undef %0, 36, 0 :: (dereferenceable invariant load (s64))
16 ; CHECK-NEXT: undef [[S_ADD_U32_:%[0-9]+]].sub1:sgpr_128 = S_ADD_U32 [[S_BUFFER_LOAD_DWORDX2_IMM]].sub0, 32, implicit-def dead $scc
17 ; CHECK-NEXT: SI_RETURN implicit [[S_ADD_U32_]].sub1
18 %0:sgpr_128 = IMPLICIT_DEF
19 %1:sreg_64_xexec = S_BUFFER_LOAD_DWORDX2_IMM %0, 36, 0 :: (dereferenceable invariant load (s64))
20 %2:sreg_32 = S_ADD_U32 %1.sub0, 32, implicit-def dead $scc
21 %0.sub1:sgpr_128 = COPY killed %2
22 SI_RETURN implicit %0.sub1
27 name: test_w_undef_dead
28 tracksRegLiveness: true
30 stackPtrOffsetReg: '$sgpr32'
33 ; CHECK-LABEL: name: test_w_undef_dead
34 ; CHECK: dead [[S_BUFFER_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec = S_BUFFER_LOAD_DWORDX2_IMM undef %0, 36, 0 :: (dereferenceable invariant load (s64))
35 ; CHECK-NEXT: undef [[S_ADD_U32_:%[0-9]+]].sub1:sgpr_128 = S_ADD_U32 undef [[S_BUFFER_LOAD_DWORDX2_IMM]].sub0, 32, implicit-def dead $scc
36 ; CHECK-NEXT: SI_RETURN implicit [[S_ADD_U32_]].sub1
37 %0:sgpr_128 = IMPLICIT_DEF
38 dead %1:sreg_64_xexec = S_BUFFER_LOAD_DWORDX2_IMM %0, 36, 0 :: (dereferenceable invariant load (s64))
39 %2:sreg_32 = S_ADD_U32 undef %1.sub0, 32, implicit-def dead $scc
40 %0.sub1:sgpr_128 = COPY killed %2
41 SI_RETURN implicit %0.sub1