1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -march=amdgcn -mcpu=gfx908 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GFX908 %s
3
4; Make sure there are no v_accvgpr_read_b32 copying back and forth
5; between AGPR and VGPR.
6define amdgpu_kernel void @remat_constant_voids_spill(i32 addrspace(1)* %p) #1 {
7; GFX908-LABEL: remat_constant_voids_spill:
8; GFX908:       ; %bb.0:
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)
25  ret void
26}
27
28define 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:
30; GFX908:       ; %bb.0:
31; GFX908-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
32; GFX908-NEXT:    v_accvgpr_write_b32 a1, v0
33; GFX908-NEXT:    v_accvgpr_write_b32 a2, v1
34; GFX908-NEXT:    v_accvgpr_write_b32 a3, v2
35; GFX908-NEXT:    v_accvgpr_write_b32 a4, v3
36; GFX908-NEXT:    ;;#ASMSTART
37; GFX908-NEXT:    ;;#ASMEND
38; GFX908-NEXT:    v_accvgpr_write_b32 a0, v8
39; GFX908-NEXT:    v_accvgpr_write_b32 a1, v4
40; GFX908-NEXT:    v_accvgpr_write_b32 a2, v5
41; GFX908-NEXT:    v_accvgpr_write_b32 a3, v6
42; GFX908-NEXT:    v_accvgpr_write_b32 a4, v7
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)
48  ret void
49}
50
51attributes #1 = { nounwind "amdgpu-num-vgpr"="8" }
52