[Mlir-commits] [mlir] [MLIR][XeGPU]Add MemoryEffect to xegpu.atomic_rmw op (PR #128076)

Nishant Patel llvmlistbot at llvm.org
Fri Feb 21 08:04:03 PST 2025


https://github.com/nbpatel updated https://github.com/llvm/llvm-project/pull/128076

>From 4b69517011f377cb06a61a1699fc2616319ab180 Mon Sep 17 00:00:00 2001
From: nbpatel <nishant.b.patel at intel.com>
Date: Thu, 20 Feb 2025 21:55:01 +0000
Subject: [PATCH 1/2] Add MemoryEffect to xegpu.atomic_rmw op

---
 mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td b/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
index 7560ede058faa..881f18dbed29c 100644
--- a/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
+++ b/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
@@ -788,6 +788,7 @@ def XeGPU_DpasOp : XeGPU_Op<"dpas", [Pure, AllElementTypesMatch<["lhs", "rhs"]>]
 }
 
 def XeGPU_AtomicRMWOp: XeGPU_Op<"atomic_rmw", [Pure,
+      MemoryEffects<[MemWrite]>,
       AllElementTypesMatch<["tensorDesc", "value", "result"]>,
       AllShapesMatch<["tensorDesc", "value", "result"]>]> {
   let summary = "Atomic ready-modify-write operation on the TensorDesc. ";

>From 15e7232dd6d2dcdec9a91ee25921b158746fe572 Mon Sep 17 00:00:00 2001
From: nbpatel <nishant.b.patel at intel.com>
Date: Fri, 21 Feb 2025 16:03:14 +0000
Subject: [PATCH 2/2] Add MemRead and fix typo

---
 mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td b/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
index 881f18dbed29c..78dfaef97420b 100644
--- a/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
+++ b/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
@@ -788,10 +788,10 @@ def XeGPU_DpasOp : XeGPU_Op<"dpas", [Pure, AllElementTypesMatch<["lhs", "rhs"]>]
 }
 
 def XeGPU_AtomicRMWOp: XeGPU_Op<"atomic_rmw", [Pure,
-      MemoryEffects<[MemWrite]>,
+      MemoryEffects<[MemRead, MemWrite]>,
       AllElementTypesMatch<["tensorDesc", "value", "result"]>,
       AllShapesMatch<["tensorDesc", "value", "result"]>]> {
-  let summary = "Atomic ready-modify-write operation on the TensorDesc. ";
+  let summary = "Atomic read-modify-write operation on the TensorDesc. ";
 
   let description = [{
     The `xegpu.atomic_rmw` operation provides a way to perform a read-modify-write



More information about the Mlir-commits mailing list