Skip to content

Commit 47861fa

Browse files
authoredOct 1, 2024
AMDGPU: Mark ds append/consume intrinsics with align 4 (llvm#110533)
Manual says the low 2 bits of the pointer are ignored.
1 parent 520562c commit 47861fa

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
 

‎llvm/include/llvm/IR/IntrinsicsAMDGPU.td

+2-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ class AMDGPUDSAppendConsumedIntrinsic : Intrinsic<
558558
[llvm_anyptr_ty, // LDS or GDS ptr
559559
llvm_i1_ty], // isVolatile
560560
[IntrConvergent, IntrWillReturn, IntrArgMemOnly,
561-
NoCapture<ArgIndex<0>>, ImmArg<ArgIndex<1>>, IntrNoCallback, IntrNoFree],
561+
Align<ArgIndex<0>, 4>, NoCapture<ArgIndex<0>>,
562+
ImmArg<ArgIndex<1>>, IntrNoCallback, IntrNoFree],
562563
"",
563564
[SDNPMemOperand]
564565
>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; REQUIRES: amdgpu-registered-target
2+
3+
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
4+
5+
; Test assumed alignment parameter
6+
7+
; CHECK: declare i32 @llvm.amdgcn.ds.append.p3(ptr addrspace(3) nocapture align 4, i1 immarg) #0
8+
9+
define i32 @ds_append(ptr addrspace(3) %ptr) {
10+
%ret = call i32 @llvm.amdgcn.ds.append.p3(ptr addrspace(3) %ptr, i1 false)
11+
ret i32 %ret
12+
}
13+
14+
; Test assumed alignment parameter
15+
; CHECK: declare i32 @llvm.amdgcn.ds.consume.p3(ptr addrspace(3) nocapture align 4, i1 immarg) #0
16+
define i32 @ds_consume(ptr addrspace(3) %ptr) {
17+
%ret = call i32 @llvm.amdgcn.ds.consume.p3(ptr addrspace(3) %ptr, i1 false)
18+
ret i32 %ret
19+
}
20+
21+
; CHECK: attributes #0 = { convergent nocallback nofree nounwind willreturn memory(argmem: readwrite) }

0 commit comments

Comments
 (0)
Please sign in to comment.