diff --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td @@ -168,6 +168,15 @@ let hasCustomAssemblyFormat = 1; } +def NVVM_SyncWarpOp : + NVVM_Op<"bar.warp.sync">, + Arguments<(ins LLVM_Type:$mask)> { + string llvmBuilder = [{ + createIntrinsicCall(builder, llvm::Intrinsic::nvvm_bar_warp_sync, {$mask}); + }]; + let assemblyFormat = "$mask attr-dict `:` type($mask)"; +} + def NVVM_CpAsyncOp : NVVM_Op<"cp.async.shared.global">, Arguments<(ins LLVM_i8Ptr_shared:$dst, diff --git a/mlir/test/Dialect/LLVMIR/nvvm.mlir b/mlir/test/Dialect/LLVMIR/nvvm.mlir --- a/mlir/test/Dialect/LLVMIR/nvvm.mlir +++ b/mlir/test/Dialect/LLVMIR/nvvm.mlir @@ -78,6 +78,13 @@ llvm.return %0 : i32 } +// CHECK-LABEL: @llvm_nvvm_bar_warp_sync +func.func @llvm_nvvm_bar_warp_sync(%mask : i32) { + // CHECK: nvvm.bar.warp.sync %{{.*}} + nvvm.bar.warp.sync %mask : i32 + llvm.return +} + // CHECK-LABEL: @nvvm_mma_m8n8k4_row_col_f32_f32 func.func @nvvm_mma_m8n8k4_row_col_f32_f32(%a0 : vector<2xf16>, %a1 : vector<2xf16>, %b0 : vector<2xf16>, %b1 : vector<2xf16>,