1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GFX908 %s
4 ; Make sure there are no v_accvgpr_read_b32 copying back and forth
5 ; between AGPR and VGPR.
6 define amdgpu_kernel void @remat_constant_voids_spill(ptr addrspace(1) %p) #1 {
7 ; GFX908-LABEL: remat_constant_voids_spill:
9 ; GFX908-NEXT: v_accvgpr_write_b32 a1, 1
10 ; GFX908-NEXT: v_accvgpr_write_b32 a5, 6
11 ; GFX908-NEXT: v_accvgpr_write_b32 a6, 7
12 ; GFX908-NEXT: v_accvgpr_write_b32 a7, 8
13 ; GFX908-NEXT: v_accvgpr_write_b32 a0, 9
14 ; GFX908-NEXT: v_accvgpr_write_b32 a2, 2
15 ; GFX908-NEXT: v_accvgpr_write_b32 a3, 3
16 ; GFX908-NEXT: v_accvgpr_write_b32 a4, 4
17 ; GFX908-NEXT: ;;#ASMSTART
18 ; GFX908-NEXT: ;;#ASMEND
19 ; GFX908-NEXT: v_accvgpr_write_b32 a1, 5
20 ; GFX908-NEXT: ;;#ASMSTART
21 ; GFX908-NEXT: ;;#ASMEND
22 ; GFX908-NEXT: s_endpgm
23 call void asm sideeffect "", "a,a,a,a"(i32 1, i32 2, i32 3, i32 4)
24 call void asm sideeffect "", "a,a,a,a,a"(i32 5, i32 6, i32 7, i32 8, i32 9)
28 define void @remat_regcopy_avoids_spill(i32 %v0, i32 %v1, i32 %v2, i32 %v3, i32 %v4, i32 %v5, i32 %v6, i32 %v7, i32 %v8, i32 %v9, i32 %v10) #1 {
29 ; GFX908-LABEL: remat_regcopy_avoids_spill:
31 ; GFX908-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
32 ; GFX908-NEXT: v_accvgpr_write_b32 a2, v0
33 ; GFX908-NEXT: v_accvgpr_write_b32 a3, v1
34 ; GFX908-NEXT: v_accvgpr_write_b32 a4, v2
35 ; GFX908-NEXT: v_accvgpr_write_b32 a0, v7
36 ; GFX908-NEXT: v_accvgpr_write_b32 a1, v8
37 ; GFX908-NEXT: v_accvgpr_write_b32 a5, v3
38 ; GFX908-NEXT: ;;#ASMSTART
39 ; GFX908-NEXT: ;;#ASMEND
40 ; GFX908-NEXT: v_accvgpr_write_b32 a2, v4
41 ; GFX908-NEXT: v_accvgpr_write_b32 a3, v5
42 ; GFX908-NEXT: v_accvgpr_write_b32 a4, v6
43 ; GFX908-NEXT: ;;#ASMSTART
44 ; GFX908-NEXT: ;;#ASMEND
45 ; GFX908-NEXT: s_setpc_b64 s[30:31]
46 call void asm sideeffect "", "a,a,a,a"(i32 %v0, i32 %v1, i32 %v2, i32 %v3)
47 call void asm sideeffect "", "a,a,a,a,a"(i32 %v4, i32 %v5, i32 %v6, i32 %v7, i32 %v8)
51 attributes #1 = { nounwind "amdgpu-num-vgpr"="8" }