Skip to content

Commit e4cbbd3

Browse files
committed
AMDGPU: Switch a test to generated checks
1 parent 5997cdb commit e4cbbd3

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

llvm/test/CodeGen/AMDGPU/copy-to-reg.ll

+60-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,69 @@
1-
; RUN: llc -mtriple=amdgcn -mattr=-promote-alloca -verify-machineinstrs < %s
2-
; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global -mattr=-promote-alloca -verify-machineinstrs < %s
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc -mtriple=amdgcn -mcpu=hawaii -disable-promote-alloca-to-vector -disable-promote-alloca-to-lds < %s | FileCheck -check-prefix=GFX7 %s
3+
; RUN: llc -mtriple=amdgcn -mcpu=tonga -disable-promote-alloca-to-vector -disable-promote-alloca-to-lds < %s | FileCheck -check-prefix=GFX8 %s
34

45
; Test that CopyToReg instructions don't have non-register operands prior
56
; to being emitted.
67

78
; Make sure this doesn't crash
8-
; CHECK-LABEL: {{^}}copy_to_reg_frameindex:
9+
910
define amdgpu_kernel void @copy_to_reg_frameindex(ptr addrspace(1) %out, i32 %a, i32 %b, i32 %c) {
11+
; GFX7-LABEL: copy_to_reg_frameindex:
12+
; GFX7: ; %bb.0: ; %entry
13+
; GFX7-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0
14+
; GFX7-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1
15+
; GFX7-NEXT: s_mov_b32 s14, -1
16+
; GFX7-NEXT: s_mov_b32 s15, 0xe8f000
17+
; GFX7-NEXT: s_add_u32 s12, s12, s11
18+
; GFX7-NEXT: s_addc_u32 s13, s13, 0
19+
; GFX7-NEXT: s_mov_b32 s0, 0
20+
; GFX7-NEXT: s_mov_b32 s1, 0
21+
; GFX7-NEXT: .LBB0_1: ; %loop
22+
; GFX7-NEXT: ; =>This Inner Loop Header: Depth=1
23+
; GFX7-NEXT: v_mov_b32_e32 v0, s1
24+
; GFX7-NEXT: v_mov_b32_e32 v1, s0
25+
; GFX7-NEXT: s_add_i32 s1, s1, 1
26+
; GFX7-NEXT: s_add_i32 s0, s0, 4
27+
; GFX7-NEXT: s_cmp_lt_u32 s1, 16
28+
; GFX7-NEXT: buffer_store_dword v0, v1, s[12:15], 0 offen
29+
; GFX7-NEXT: s_cbranch_scc1 .LBB0_1
30+
; GFX7-NEXT: ; %bb.2: ; %done
31+
; GFX7-NEXT: buffer_load_dword v0, off, s[12:15], 0
32+
; GFX7-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9
33+
; GFX7-NEXT: s_mov_b32 s3, 0xf000
34+
; GFX7-NEXT: s_mov_b32 s2, -1
35+
; GFX7-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
36+
; GFX7-NEXT: buffer_store_dword v0, off, s[0:3], 0
37+
; GFX7-NEXT: s_endpgm
38+
;
39+
; GFX8-LABEL: copy_to_reg_frameindex:
40+
; GFX8: ; %bb.0: ; %entry
41+
; GFX8-NEXT: s_mov_b32 s88, SCRATCH_RSRC_DWORD0
42+
; GFX8-NEXT: s_mov_b32 s89, SCRATCH_RSRC_DWORD1
43+
; GFX8-NEXT: s_mov_b32 s90, -1
44+
; GFX8-NEXT: s_mov_b32 s91, 0xe80000
45+
; GFX8-NEXT: s_add_u32 s88, s88, s11
46+
; GFX8-NEXT: s_addc_u32 s89, s89, 0
47+
; GFX8-NEXT: s_mov_b32 s0, 0
48+
; GFX8-NEXT: s_mov_b32 s1, 0
49+
; GFX8-NEXT: .LBB0_1: ; %loop
50+
; GFX8-NEXT: ; =>This Inner Loop Header: Depth=1
51+
; GFX8-NEXT: v_mov_b32_e32 v0, s1
52+
; GFX8-NEXT: v_mov_b32_e32 v1, s0
53+
; GFX8-NEXT: s_add_i32 s1, s1, 1
54+
; GFX8-NEXT: s_add_i32 s0, s0, 4
55+
; GFX8-NEXT: s_cmp_lt_u32 s1, 16
56+
; GFX8-NEXT: buffer_store_dword v0, v1, s[88:91], 0 offen
57+
; GFX8-NEXT: s_cbranch_scc1 .LBB0_1
58+
; GFX8-NEXT: ; %bb.2: ; %done
59+
; GFX8-NEXT: buffer_load_dword v2, off, s[88:91], 0
60+
; GFX8-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x24
61+
; GFX8-NEXT: s_waitcnt lgkmcnt(0)
62+
; GFX8-NEXT: v_mov_b32_e32 v0, s0
63+
; GFX8-NEXT: v_mov_b32_e32 v1, s1
64+
; GFX8-NEXT: s_waitcnt vmcnt(0)
65+
; GFX8-NEXT: flat_store_dword v[0:1], v2
66+
; GFX8-NEXT: s_endpgm
1067
entry:
1168
%alloca = alloca [16 x i32], addrspace(5)
1269
br label %loop

0 commit comments

Comments
 (0)