[ROCDL] Added missing s.get.named.barrier.state op (gfx1250)#167876
Merged
ravil-mobile merged 1 commit intollvm:mainfrom Nov 13, 2025
Merged
[ROCDL] Added missing s.get.named.barrier.state op (gfx1250)#167876ravil-mobile merged 1 commit intollvm:mainfrom
ravil-mobile merged 1 commit intollvm:mainfrom
Conversation
Member
|
@llvm/pr-subscribers-mlir Author: Ravil Dorozhinskii (ravil-mobile) ChangesThis patch introduces some missing s.get.named.barrier.state instructions in the ROCDL dialect Full diff: https://github.com/llvm/llvm-project/pull/167876.diff 3 Files Affected:
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 3d8bf9c169406..963078882c59d 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -390,6 +390,15 @@ def ROCDL_GetBarrierStateOp : ROCDL_ConcreteNonMemIntrOp<"s.get.barrier.state",
let assemblyFormat = "$id attr-dict `:` type($res)";
}
+def ROCDL_GetNamedBarrierStateOp : ROCDL_ConcreteNonMemIntrOp<"s.get.named.barrier.state", [], 1, [], []>,
+ Arguments<(ins Arg<ROCDLBufferLDS, "", []>:$ptr)> {
+ let description = [{
+ Available on gfx1250+.
+ }];
+ let results = (outs I32:$res);
+ let assemblyFormat = "$ptr attr-dict `:` type($res)";
+}
+
def ROCDL_WaitDscntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.dscnt", [], 0, [0], ["count"]>,
Arguments<(ins I16Attr:$count)> {
let summary = "Wait until DSCNT is less than or equal to `count`";
diff --git a/mlir/test/Dialect/LLVMIR/rocdl.mlir b/mlir/test/Dialect/LLVMIR/rocdl.mlir
index d50cc41684e3c..9131c8ee9e598 100644
--- a/mlir/test/Dialect/LLVMIR/rocdl.mlir
+++ b/mlir/test/Dialect/LLVMIR/rocdl.mlir
@@ -1083,6 +1083,13 @@ llvm.func @rocdl.s.get.barrier.state() {
llvm.return
}
+llvm.func @rocdl.s.get.named.barrier.state(%ptr : !llvm.ptr<3>) {
+ // CHECK-LABEL: rocdl.s.get.named.barrier.state
+ // CHECK: rocdl.s.get.named.barrier.state %[[PTR:.+]]
+ %0 = rocdl.s.get.named.barrier.state %ptr : i32
+ llvm.return
+}
+
llvm.func @rocdl.s.wait.dscnt() {
// CHECK-LABEL: rocdl.s.wait.dscnt
// CHECK: rocdl.s.wait.dscnt 0
diff --git a/mlir/test/Target/LLVMIR/rocdl.mlir b/mlir/test/Target/LLVMIR/rocdl.mlir
index db02918d7186c..ca1620b81c318 100644
--- a/mlir/test/Target/LLVMIR/rocdl.mlir
+++ b/mlir/test/Target/LLVMIR/rocdl.mlir
@@ -248,6 +248,13 @@ llvm.func @rocdl.s.get.barrier.state() {
llvm.return
}
+llvm.func @rocdl.s.get.named.barrier.state(%ptr : !llvm.ptr<3>) {
+ // CHECK-LABEL: rocdl.s.get.named.barrier.state
+ // CHECK: %[[STATE:.+]] = call i32 @llvm.amdgcn.s.get.named.barrier.state(ptr addrspace(3) %[[PTR:.+]])
+ %0 = rocdl.s.get.named.barrier.state %ptr : i32
+ llvm.return
+}
+
llvm.func @rocdl.s.wait.dscnt() {
// CHECK-LABEL: rocdl.s.wait.dscnt
// CHECK-NEXT: call void @llvm.amdgcn.s.wait.dscnt(i16 0)
|
Member
|
@llvm/pr-subscribers-mlir-llvm Author: Ravil Dorozhinskii (ravil-mobile) ChangesThis patch introduces some missing s.get.named.barrier.state instructions in the ROCDL dialect Full diff: https://github.com/llvm/llvm-project/pull/167876.diff 3 Files Affected:
diff --git a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
index 3d8bf9c169406..963078882c59d 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
@@ -390,6 +390,15 @@ def ROCDL_GetBarrierStateOp : ROCDL_ConcreteNonMemIntrOp<"s.get.barrier.state",
let assemblyFormat = "$id attr-dict `:` type($res)";
}
+def ROCDL_GetNamedBarrierStateOp : ROCDL_ConcreteNonMemIntrOp<"s.get.named.barrier.state", [], 1, [], []>,
+ Arguments<(ins Arg<ROCDLBufferLDS, "", []>:$ptr)> {
+ let description = [{
+ Available on gfx1250+.
+ }];
+ let results = (outs I32:$res);
+ let assemblyFormat = "$ptr attr-dict `:` type($res)";
+}
+
def ROCDL_WaitDscntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.dscnt", [], 0, [0], ["count"]>,
Arguments<(ins I16Attr:$count)> {
let summary = "Wait until DSCNT is less than or equal to `count`";
diff --git a/mlir/test/Dialect/LLVMIR/rocdl.mlir b/mlir/test/Dialect/LLVMIR/rocdl.mlir
index d50cc41684e3c..9131c8ee9e598 100644
--- a/mlir/test/Dialect/LLVMIR/rocdl.mlir
+++ b/mlir/test/Dialect/LLVMIR/rocdl.mlir
@@ -1083,6 +1083,13 @@ llvm.func @rocdl.s.get.barrier.state() {
llvm.return
}
+llvm.func @rocdl.s.get.named.barrier.state(%ptr : !llvm.ptr<3>) {
+ // CHECK-LABEL: rocdl.s.get.named.barrier.state
+ // CHECK: rocdl.s.get.named.barrier.state %[[PTR:.+]]
+ %0 = rocdl.s.get.named.barrier.state %ptr : i32
+ llvm.return
+}
+
llvm.func @rocdl.s.wait.dscnt() {
// CHECK-LABEL: rocdl.s.wait.dscnt
// CHECK: rocdl.s.wait.dscnt 0
diff --git a/mlir/test/Target/LLVMIR/rocdl.mlir b/mlir/test/Target/LLVMIR/rocdl.mlir
index db02918d7186c..ca1620b81c318 100644
--- a/mlir/test/Target/LLVMIR/rocdl.mlir
+++ b/mlir/test/Target/LLVMIR/rocdl.mlir
@@ -248,6 +248,13 @@ llvm.func @rocdl.s.get.barrier.state() {
llvm.return
}
+llvm.func @rocdl.s.get.named.barrier.state(%ptr : !llvm.ptr<3>) {
+ // CHECK-LABEL: rocdl.s.get.named.barrier.state
+ // CHECK: %[[STATE:.+]] = call i32 @llvm.amdgcn.s.get.named.barrier.state(ptr addrspace(3) %[[PTR:.+]])
+ %0 = rocdl.s.get.named.barrier.state %ptr : i32
+ llvm.return
+}
+
llvm.func @rocdl.s.wait.dscnt() {
// CHECK-LABEL: rocdl.s.wait.dscnt
// CHECK-NEXT: call void @llvm.amdgcn.s.wait.dscnt(i16 0)
|
kuhar
approved these changes
Nov 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch introduces some missing s.get.named.barrier.state instructions in the ROCDL dialect