|
| 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 |
| 3 | + |
| 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. |
| 8 | + |
| 9 | +--- |
| 10 | +name: coalescing_makes_lane_undefined |
| 11 | +tracksRegLiveness: true |
| 12 | +body: | |
| 13 | + ; CHECK-LABEL: name: coalescing_makes_lane_undefined |
| 14 | + ; CHECK: bb.0: |
| 15 | + ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000) |
| 16 | + ; CHECK: S_CBRANCH_SCC0 %bb.2, implicit undef $scc |
| 17 | + ; CHECK: bb.1: |
| 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 |
| 22 | + ; CHECK: bb.2: |
| 23 | + ; CHECK: successors: %bb.3(0x80000000) |
| 24 | + ; CHECK: undef %0.sub0:sgpr_64 = IMPLICIT_DEF |
| 25 | + ; CHECK: bb.3: |
| 26 | + ; CHECK: S_NOP 0, implicit %0.sub0 |
| 27 | + ; CHECK: S_NOP 0, implicit %0 |
| 28 | + bb.0: |
| 29 | + successors: %bb.1, %bb.2 |
| 30 | + S_CBRANCH_SCC0 %bb.2, implicit undef $scc |
| 31 | +
|
| 32 | + bb.1: |
| 33 | + successors: %bb.3 |
| 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 |
| 37 | + S_BRANCH %bb.3 |
| 38 | +
|
| 39 | + bb.2: |
| 40 | + successors: %bb.3 |
| 41 | + %2:sgpr_32 = IMPLICIT_DEF |
| 42 | + undef %1.sub0:sgpr_64 = IMPLICIT_DEF |
| 43 | + %1.sub1:sgpr_64 = IMPLICIT_DEF |
| 44 | +
|
| 45 | + bb.3: |
| 46 | + S_NOP 0, implicit killed %2 |
| 47 | + S_NOP 0, implicit killed %1 |
| 48 | +
|
| 49 | +... |
0 commit comments