1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx803 -run-pass simple-register-coalescing -verify-machineinstrs -o - %s | FileCheck %s
4 # Register coalescer is going to eliminate %2:sgpr_32 = COPY %1.sub0 from bb.1
5 # by joining %2 and %1.sub0 into %0.sub0 register. Check that when this happen
6 # the implicit intialization of %0.sub0 in the bb.2 have undef flag
7 # for the MIR to be valid.
10 name: coalescing_makes_lane_undefined
11 tracksRegLiveness: true
13 ; CHECK-LABEL: name: coalescing_makes_lane_undefined
15 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
16 ; CHECK: S_CBRANCH_SCC0 %bb.2, implicit undef $scc
18 ; CHECK: successors: %bb.3(0x80000000)
19 ; CHECK: undef %0.sub0:sgpr_64 = S_MOV_B32 1
20 ; CHECK: %0.sub1:sgpr_64 = S_MOV_B32 2
21 ; CHECK: S_BRANCH %bb.3
23 ; CHECK: successors: %bb.3(0x80000000)
24 ; CHECK: undef %0.sub0:sgpr_64 = IMPLICIT_DEF
26 ; CHECK: S_NOP 0, implicit %0.sub0
27 ; CHECK: S_NOP 0, implicit %0
29 successors: %bb.1, %bb.2
30 S_CBRANCH_SCC0 %bb.2, implicit undef $scc
34 undef %1.sub0:sgpr_64 = S_MOV_B32 1
35 %1.sub1:sgpr_64 = S_MOV_B32 2
36 %2:sgpr_32 = COPY %1.sub0 ; copy to be joined
41 %2:sgpr_32 = IMPLICIT_DEF
42 undef %1.sub0:sgpr_64 = IMPLICIT_DEF
43 %1.sub1:sgpr_64 = IMPLICIT_DEF
46 S_NOP 0, implicit killed %2
47 S_NOP 0, implicit killed %1