[Mlir-commits] [mlir] 4b38d17 - [mlir][nvvm] Introduce `mbarrier.inval`
Guray Ozen
llvmlistbot at llvm.org
Fri Jun 16 04:39:16 PDT 2023
Author: Guray Ozen
Date: 2023-06-16T13:39:11+02:00
New Revision: 4b38d17ff56a70f273abaa0e32b8c3111f6bb4f5
URL: https://github.com/llvm/llvm-project/commit/4b38d17ff56a70f273abaa0e32b8c3111f6bb4f5
DIFF: https://github.com/llvm/llvm-project/commit/4b38d17ff56a70f273abaa0e32b8c3111f6bb4f5.diff
LOG: [mlir][nvvm] Introduce `mbarrier.inval`
Introduce support for PTX's `mbarrier.inval` .
Contiunation of D151334
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D151338
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
mlir/test/Dialect/LLVMIR/nvvm.mlir
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
index 118e784851517..44aa4aa980ee2 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
@@ -197,6 +197,22 @@ def NVVM_MBarrierInitSharedOp : NVVM_Op<"mbarrier.init.shared">,
let assemblyFormat = "$addr `,` $count attr-dict `:` type(operands)";
}
+def NVVM_MBarrierInvalOp : NVVM_Op<"mbarrier.inval">,
+ Arguments<(ins LLVM_i64ptr_any:$addr)> {
+ string llvmBuilder = [{
+ createIntrinsicCall(builder, llvm::Intrinsic::nvvm_mbarrier_inval, {$addr});
+ }];
+ let assemblyFormat = "$addr attr-dict `:` type(operands)";
+}
+
+def NVVM_MBarrierInvalSharedOp : NVVM_Op<"mbarrier.inval.shared">,
+ Arguments<(ins LLVM_i64ptr_shared:$addr)> {
+ string llvmBuilder = [{
+ createIntrinsicCall(builder, llvm::Intrinsic::nvvm_mbarrier_inval_shared, {$addr});
+ }];
+ let assemblyFormat = "$addr attr-dict `:` type(operands)";
+}
+
//===----------------------------------------------------------------------===//
// NVVM synchronization op definitions
//===----------------------------------------------------------------------===//
diff --git a/mlir/test/Dialect/LLVMIR/nvvm.mlir b/mlir/test/Dialect/LLVMIR/nvvm.mlir
index d08d02a04d8f8..a32b33d410f59 100644
--- a/mlir/test/Dialect/LLVMIR/nvvm.mlir
+++ b/mlir/test/Dialect/LLVMIR/nvvm.mlir
@@ -353,3 +353,17 @@ llvm.func private @mbarrier_init_shared(%barrier: !llvm.ptr<3>) {
nvvm.mbarrier.init.shared %barrier, %count : !llvm.ptr<3>, i32
llvm.return
}
+
+
+llvm.func private @mbarrier_inval_generic(%barrier: !llvm.ptr) {
+ // CHECK: nvvm.mbarrier.inval %{{.*}} : !llvm.ptr
+ nvvm.mbarrier.inval %barrier : !llvm.ptr
+ llvm.return
+}
+
+
+llvm.func private @mbarrier_inval_shared(%barrier: !llvm.ptr<3>) {
+ // CHECK: nvvm.mbarrier.inval.shared %{{.*}} : !llvm.ptr<3>
+ nvvm.mbarrier.inval.shared %barrier : !llvm.ptr<3>
+ llvm.return
+}
More information about the Mlir-commits
mailing list