1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=regallocfast -o - %s | FileCheck -check-prefix=SPILLED %s
3 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=regallocfast,si-lower-sgpr-spills -o - %s | FileCheck -check-prefix=EXPANDED %s
5 # Make sure spill/restore of 224 bit registers works.
8 name: spill_restore_sgpr224
9 tracksRegLiveness: true
11 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
12 stackPtrOffsetReg: $sgpr32
14 ; SPILLED-LABEL: name: spill_restore_sgpr224
16 ; SPILLED: successors: %bb.1(0x80000000)
17 ; SPILLED: S_NOP 0, implicit-def renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
18 ; SPILLED: SI_SPILL_S224_SAVE killed $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10, %stack.0, implicit $exec, implicit $sgpr32 :: (store (s224) into %stack.0, align 4, addrspace 5)
19 ; SPILLED: S_CBRANCH_SCC1 %bb.1, implicit undef $scc
21 ; SPILLED: successors: %bb.2(0x80000000)
24 ; SPILLED: $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10 = SI_SPILL_S224_RESTORE %stack.0, implicit $exec, implicit $sgpr32 :: (load (s224) from %stack.0, align 4, addrspace 5)
25 ; SPILLED: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
26 ; EXPANDED-LABEL: name: spill_restore_sgpr224
28 ; EXPANDED: successors: %bb.1(0x80000000)
29 ; EXPANDED: liveins: $vgpr0
30 ; EXPANDED: S_NOP 0, implicit-def renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
31 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 $sgpr4, 0, $vgpr0, implicit-def $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10, implicit $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
32 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 $sgpr5, 1, $vgpr0, implicit $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
33 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 $sgpr6, 2, $vgpr0, implicit $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
34 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 $sgpr7, 3, $vgpr0, implicit $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
35 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 $sgpr8, 4, $vgpr0, implicit $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
36 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 $sgpr9, 5, $vgpr0, implicit $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
37 ; EXPANDED: $vgpr0 = V_WRITELANE_B32 killed $sgpr10, 6, $vgpr0, implicit killed $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
38 ; EXPANDED: S_CBRANCH_SCC1 %bb.1, implicit undef $scc
40 ; EXPANDED: successors: %bb.2(0x80000000)
41 ; EXPANDED: liveins: $vgpr0
44 ; EXPANDED: liveins: $vgpr0
45 ; EXPANDED: $sgpr4 = V_READLANE_B32 $vgpr0, 0, implicit-def $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
46 ; EXPANDED: $sgpr5 = V_READLANE_B32 $vgpr0, 1
47 ; EXPANDED: $sgpr6 = V_READLANE_B32 $vgpr0, 2
48 ; EXPANDED: $sgpr7 = V_READLANE_B32 $vgpr0, 3
49 ; EXPANDED: $sgpr8 = V_READLANE_B32 $vgpr0, 4
50 ; EXPANDED: $sgpr9 = V_READLANE_B32 $vgpr0, 5
51 ; EXPANDED: $sgpr10 = V_READLANE_B32 $vgpr0, 6
52 ; EXPANDED: S_NOP 0, implicit killed renamable $sgpr4_sgpr5_sgpr6_sgpr7_sgpr8_sgpr9_sgpr10
54 S_NOP 0, implicit-def %0:sgpr_224
55 S_CBRANCH_SCC1 implicit undef $scc, %bb.1
65 name: spill_restore_vgpr224
66 tracksRegLiveness: true
68 scratchRSrcReg: $sgpr0_sgpr1_sgpr2_sgpr3
69 stackPtrOffsetReg: $sgpr32
71 ; SPILLED-LABEL: name: spill_restore_vgpr224
73 ; SPILLED: successors: %bb.1(0x80000000)
74 ; SPILLED: S_NOP 0, implicit-def renamable $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6
75 ; SPILLED: SI_SPILL_V224_SAVE killed $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6, %stack.0, $sgpr32, 0, implicit $exec :: (store (s224) into %stack.0, align 4, addrspace 5)
76 ; SPILLED: S_CBRANCH_SCC1 %bb.1, implicit undef $scc
78 ; SPILLED: successors: %bb.2(0x80000000)
81 ; SPILLED: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6 = SI_SPILL_V224_RESTORE %stack.0, $sgpr32, 0, implicit $exec :: (load (s224) from %stack.0, align 4, addrspace 5)
82 ; SPILLED: S_NOP 0, implicit killed renamable $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6
83 ; EXPANDED-LABEL: name: spill_restore_vgpr224
85 ; EXPANDED: successors: %bb.1(0x80000000)
86 ; EXPANDED: S_NOP 0, implicit-def renamable $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6
87 ; EXPANDED: SI_SPILL_V224_SAVE killed $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6, %stack.0, $sgpr32, 0, implicit $exec :: (store (s224) into %stack.0, align 4, addrspace 5)
88 ; EXPANDED: S_CBRANCH_SCC1 %bb.1, implicit undef $scc
90 ; EXPANDED: successors: %bb.2(0x80000000)
93 ; EXPANDED: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6 = SI_SPILL_V224_RESTORE %stack.0, $sgpr32, 0, implicit $exec :: (load (s224) from %stack.0, align 4, addrspace 5)
94 ; EXPANDED: S_NOP 0, implicit killed renamable $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6
96 S_NOP 0, implicit-def %0:vreg_224
97 S_CBRANCH_SCC1 implicit undef $scc, %bb.1