[llvm-branch-commits] [mlir] [MLIR][ROCDL] Note the deprecation of the <4 x i32> buffer ops (PR #231303)
Krzysztof Drewniak via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Oct 13 09:59:57 PDT 2026
https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/231303
>From 5419e452b257711f9173e469009ac8d24de6eb58 Mon Sep 17 00:00:00 2001
From: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
Date: Fri, 9 Oct 2026 16:56:07 +0000
Subject: [PATCH] [MLIR][ROCDL] Note the deprecation of the <4 x i32> buffer
ops
While we don't have a way to flag a MLIR op as deprecated yet, go
ahead and add a note to the old `<4 x i32>` intriinsic ops that
they're actively deprecated.
AI disclosure: Claude made this edit, though I checked the wording and
wrote up this message.
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
---
mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td | 24 ++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 716fd92e810ace..c05b10b94fb73e 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -2139,6 +2139,23 @@ def ROCDL_RawPtrBufferAtomicUminOp : ROCDL_RawPtrBufferAtomicRet<"umin">;
// Note: not supported on all architectures
def ROCDL_RawPtrBufferAtomicFaddOp : ROCDL_RawPtrBufferAtomicRet<"fadd">;
+//===---------------------------------------------------------------------===//
+// Deprecated raw buffer ops taking a vector<4xi32> resource
+
+// Shared documentation for the ops that take their buffer resource as a
+// vector<4xi32> and map to the deprecated llvm.amdgcn.raw.buffer.* intrinsics.
+// `suffix` is the part of the intrinsic name after "raw.buffer.", and also
+// selects the rocdl.raw.ptr.buffer.* replacement.
+class ROCDL_DeprecatedV4I32BufferDoc<string suffix> {
+ string description = [{
+ Deprecated. This op takes its buffer resource as a `vector<4xi32>` and maps
+ to `llvm.amdgcn.raw.buffer.}] # suffix # [{`, which is deprecated and will
+ be removed in a future LLVM release. Use `rocdl.raw.ptr.buffer.}]
+ # suffix # [{`, which takes a `!llvm.ptr<8>` resource produced by
+ `rocdl.make.buffer.rsrc`, instead.
+ }];
+}
+
//===---------------------------------------------------------------------===//
// Raw buffer load/store intrinsics
@@ -2148,6 +2165,7 @@ def ROCDL_RawBufferLoadOp :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_NonAtomicBufferCachePolicyCompatAttr>:$aux)> {
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"load">.description;
let assemblyFormat = "$rsrc `,` $offset `,` $soffset `,` custom<CachePolicy>($aux) attr-dict `:` type($res)";
}
@@ -2158,6 +2176,7 @@ def ROCDL_RawBufferStoreOp :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_NonAtomicBufferCachePolicyCompatAttr>:$aux)>{
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"store">.description;
let assemblyFormat = "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom<CachePolicy>($aux) attr-dict `:` type($vdata)";
}
@@ -2170,6 +2189,7 @@ def ROCDL_RawBufferAtomicCmpSwap :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_AtomicBufferCachePolicyCompatAttr>:$aux)>{
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"atomic.cmpswap">.description;
let assemblyFormat = [{
attr-dict `(` $src `,` $cmp `,` $rsrc `,` $offset `,` $soffset `,`
custom<CachePolicy>($aux) `)` `:` type($res) `,` type($rsrc)
@@ -2292,6 +2312,7 @@ def ROCDL_RawBufferAtomicFAddOp :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_AtomicBufferCachePolicyCompatAttr>:$aux)>{
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"atomic.fadd">.description;
let assemblyFormat = "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom<CachePolicy>($aux) attr-dict `:` type($vdata)";
}
@@ -2306,6 +2327,7 @@ def ROCDL_RawBufferAtomicFMaxOp :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_AtomicBufferCachePolicyCompatAttr>:$aux)>{
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"atomic.fmax">.description;
let assemblyFormat = "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom<CachePolicy>($aux) attr-dict `:` type($vdata)";
}
@@ -2320,6 +2342,7 @@ def ROCDL_RawBufferAtomicSMaxOp :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_AtomicBufferCachePolicyCompatAttr>:$aux)>{
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"atomic.smax">.description;
let assemblyFormat = "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom<CachePolicy>($aux) attr-dict `:` type($vdata)";
}
@@ -2334,6 +2357,7 @@ def ROCDL_RawBufferAtomicUMinOp :
I32:$offset,
I32:$soffset,
ROCDL_DefaultCachePolicyAttr<ROCDL_AtomicBufferCachePolicyCompatAttr>:$aux)>{
+ let description = ROCDL_DeprecatedV4I32BufferDoc<"atomic.umin">.description;
let assemblyFormat = "$vdata `,` $rsrc `,` $offset `,` $soffset `,` custom<CachePolicy>($aux) attr-dict `:` type($vdata)";
}
More information about the llvm-branch-commits
mailing list