1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs -stress-regalloc=2 -start-before=greedy -stop-after=virtregmap -o - %s | FileCheck %s
4 # Test that a spill of a copy of m0 is not folded to be a spill of m0 directly.
8 name: merge_sgpr_spill_into_copy_from_m0
9 tracksRegLiveness: true
15 ; CHECK-LABEL: name: merge_sgpr_spill_into_copy_from_m0
16 ; CHECK: liveins: $vgpr0
18 ; CHECK-NEXT: S_NOP 0, implicit-def $m0
19 ; CHECK-NEXT: $sgpr0 = S_MOV_B32 $m0
20 ; CHECK-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr0, 0, $vgpr0
21 ; CHECK-NEXT: $sgpr0 = V_READLANE_B32 $vgpr0, 0
22 ; CHECK-NEXT: S_NOP 0, implicit-def dead renamable $sgpr1, implicit-def dead renamable $sgpr0, implicit killed renamable $sgpr0
23 ; CHECK-NEXT: $sgpr0 = V_READLANE_B32 $vgpr0, 0
24 ; CHECK-NEXT: $m0 = S_MOV_B32 killed $sgpr0
26 ; CHECK-NEXT: S_SENDMSG 0, implicit $m0, implicit $exec
27 S_NOP 0, implicit-def $m0
29 S_NOP 0, implicit-def %1:sreg_32, implicit-def %2:sreg_32, implicit %0
31 S_SENDMSG 0, implicit $m0, implicit $exec
35 # Test that a reload into a copy of m0 is not folded to be a reload of m0 directly.
39 name: reload_sgpr_spill_into_copy_to_m0
40 tracksRegLiveness: true
46 ; CHECK-LABEL: name: reload_sgpr_spill_into_copy_to_m0
47 ; CHECK: liveins: $vgpr0
49 ; CHECK-NEXT: S_NOP 0, implicit-def renamable $sgpr0, implicit-def dead renamable $sgpr1, implicit-def $m0
50 ; CHECK-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr0, 0, $vgpr0
51 ; CHECK-NEXT: $sgpr0 = V_READLANE_B32 $vgpr0, 0
52 ; CHECK-NEXT: S_NOP 0, implicit killed renamable $sgpr0, implicit-def dead renamable $sgpr1, implicit-def dead renamable $sgpr0
53 ; CHECK-NEXT: $sgpr0 = V_READLANE_B32 $vgpr0, 0
54 ; CHECK-NEXT: $m0 = S_MOV_B32 killed $sgpr0
56 ; CHECK-NEXT: S_SENDMSG 0, implicit $m0, implicit $exec
57 S_NOP 0, implicit-def %0:sreg_32, implicit-def %1:sreg_32, implicit-def $m0
58 S_NOP 0, implicit %0, implicit-def %3:sreg_32, implicit-def %4:sreg_32
60 S_SENDMSG 0, implicit $m0, implicit $exec