annotate llvm/test/CodeGen/AMDGPU/llvm.amdgcn.writelane.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx700 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,CI,CIGFX9 %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx802 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,GFX9,CIGFX9 %s
anatofuz
parents:
diff changeset
3 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=CHECK,GFX10 %s
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 declare i32 @llvm.amdgcn.writelane(i32, i32, i32) #0
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 ; CHECK-LABEL: {{^}}test_writelane_sreg:
anatofuz
parents:
diff changeset
8 ; CIGFX9: v_writelane_b32 v{{[0-9]+}}, s{{[0-9]+}}, m0
anatofuz
parents:
diff changeset
9 ; GFX10: v_writelane_b32 v{{[0-9]+}}, s{{[0-9]+}}, s{{[0-9]+}}
anatofuz
parents:
diff changeset
10 define amdgpu_kernel void @test_writelane_sreg(i32 addrspace(1)* %out, i32 %src0, i32 %src1) #1 {
anatofuz
parents:
diff changeset
11 %oldval = load i32, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
12 %writelane = call i32 @llvm.amdgcn.writelane(i32 %src0, i32 %src1, i32 %oldval)
anatofuz
parents:
diff changeset
13 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
14 ret void
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 ; CHECK-LABEL: {{^}}test_writelane_imm_sreg:
anatofuz
parents:
diff changeset
18 ; CHECK: v_writelane_b32 v{{[0-9]+}}, 32, s{{[0-9]+}}
anatofuz
parents:
diff changeset
19 define amdgpu_kernel void @test_writelane_imm_sreg(i32 addrspace(1)* %out, i32 %src1) #1 {
anatofuz
parents:
diff changeset
20 %oldval = load i32, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
21 %writelane = call i32 @llvm.amdgcn.writelane(i32 32, i32 %src1, i32 %oldval)
anatofuz
parents:
diff changeset
22 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
23 ret void
anatofuz
parents:
diff changeset
24 }
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 ; CHECK-LABEL: {{^}}test_writelane_vreg_lane:
anatofuz
parents:
diff changeset
27 ; CHECK: v_readfirstlane_b32 [[LANE:s[0-9]+]], v{{[0-9]+}}
anatofuz
parents:
diff changeset
28 ; CHECK: v_writelane_b32 v{{[0-9]+}}, 12, [[LANE]]
anatofuz
parents:
diff changeset
29 define amdgpu_kernel void @test_writelane_vreg_lane(i32 addrspace(1)* %out, <2 x i32> addrspace(1)* %in) #1 {
anatofuz
parents:
diff changeset
30 %tid = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
31 %gep.in = getelementptr <2 x i32>, <2 x i32> addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
32 %args = load <2 x i32>, <2 x i32> addrspace(1)* %gep.in
anatofuz
parents:
diff changeset
33 %oldval = load i32, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
34 %lane = extractelement <2 x i32> %args, i32 1
anatofuz
parents:
diff changeset
35 %writelane = call i32 @llvm.amdgcn.writelane(i32 12, i32 %lane, i32 %oldval)
anatofuz
parents:
diff changeset
36 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
37 ret void
anatofuz
parents:
diff changeset
38 }
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 ; CHECK-LABEL: {{^}}test_writelane_m0_sreg:
anatofuz
parents:
diff changeset
41 ; CHECK: s_mov_b32 m0, -1
anatofuz
parents:
diff changeset
42 ; CIGFX9: s_mov_b32 [[COPY_M0:s[0-9]+]], m0
anatofuz
parents:
diff changeset
43 ; CIGFX9: v_writelane_b32 v{{[0-9]+}}, [[COPY_M0]], m0
anatofuz
parents:
diff changeset
44 ; GFX10: v_writelane_b32 v{{[0-9]+}}, m0, s{{[0-9]+}}
anatofuz
parents:
diff changeset
45 define amdgpu_kernel void @test_writelane_m0_sreg(i32 addrspace(1)* %out, i32 %src1) #1 {
anatofuz
parents:
diff changeset
46 %oldval = load i32, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
47 %m0 = call i32 asm "s_mov_b32 m0, -1", "={m0}"()
anatofuz
parents:
diff changeset
48 %writelane = call i32 @llvm.amdgcn.writelane(i32 %m0, i32 %src1, i32 %oldval)
anatofuz
parents:
diff changeset
49 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
50 ret void
anatofuz
parents:
diff changeset
51 }
anatofuz
parents:
diff changeset
52
anatofuz
parents:
diff changeset
53 ; CHECK-LABEL: {{^}}test_writelane_imm:
anatofuz
parents:
diff changeset
54 ; CHECK: v_writelane_b32 v{{[0-9]+}}, s{{[0-9]+}}, 32
anatofuz
parents:
diff changeset
55 define amdgpu_kernel void @test_writelane_imm(i32 addrspace(1)* %out, i32 %src0) #1 {
anatofuz
parents:
diff changeset
56 %oldval = load i32, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
57 %writelane = call i32 @llvm.amdgcn.writelane(i32 %src0, i32 32, i32 %oldval) #0
anatofuz
parents:
diff changeset
58 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
59 ret void
anatofuz
parents:
diff changeset
60 }
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 ; CHECK-LABEL: {{^}}test_writelane_sreg_oldval:
anatofuz
parents:
diff changeset
63 ; CHECK: v_mov_b32_e32 [[OLDVAL:v[0-9]+]], s{{[0-9]+}}
anatofuz
parents:
diff changeset
64 ; CIGFX9: v_writelane_b32 [[OLDVAL]], s{{[0-9]+}}, m0
anatofuz
parents:
diff changeset
65 ; GFX10: v_writelane_b32 [[OLDVAL]], s{{[0-9]+}}, s{{[0-9]+}}
anatofuz
parents:
diff changeset
66 define amdgpu_kernel void @test_writelane_sreg_oldval(i32 inreg %oldval, i32 addrspace(1)* %out, i32 %src0, i32 %src1) #1 {
anatofuz
parents:
diff changeset
67 %writelane = call i32 @llvm.amdgcn.writelane(i32 %src0, i32 %src1, i32 %oldval)
anatofuz
parents:
diff changeset
68 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
69 ret void
anatofuz
parents:
diff changeset
70 }
anatofuz
parents:
diff changeset
71
anatofuz
parents:
diff changeset
72 ; CHECK-LABEL: {{^}}test_writelane_imm_oldval:
anatofuz
parents:
diff changeset
73 ; CHECK: v_mov_b32_e32 [[OLDVAL:v[0-9]+]], 42
anatofuz
parents:
diff changeset
74 ; CIGFX9: v_writelane_b32 [[OLDVAL]], s{{[0-9]+}}, m0
anatofuz
parents:
diff changeset
75 ; GFX10: v_writelane_b32 [[OLDVAL]], s{{[0-9]+}}, s{{[0-9]+}}
anatofuz
parents:
diff changeset
76 define amdgpu_kernel void @test_writelane_imm_oldval(i32 addrspace(1)* %out, i32 %src0, i32 %src1) #1 {
anatofuz
parents:
diff changeset
77 %writelane = call i32 @llvm.amdgcn.writelane(i32 %src0, i32 %src1, i32 42)
anatofuz
parents:
diff changeset
78 store i32 %writelane, i32 addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
79 ret void
anatofuz
parents:
diff changeset
80 }
anatofuz
parents:
diff changeset
81
anatofuz
parents:
diff changeset
82 declare i32 @llvm.amdgcn.workitem.id.x() #2
anatofuz
parents:
diff changeset
83
anatofuz
parents:
diff changeset
84 attributes #0 = { nounwind readnone convergent }
anatofuz
parents:
diff changeset
85 attributes #1 = { nounwind }
anatofuz
parents:
diff changeset
86 attributes #2 = { nounwind readnone }