[Mlir-commits] [mlir] 9964c2c - [MILR][NVVM] Fix missing semicolon in nvvm.barrier.arrive Op (#92769)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon May 20 09:56:53 PDT 2024


Author: Pradeep Kumar
Date: 2024-05-20T22:26:49+05:30
New Revision: 9964c2c33d750d60b512d518899fa2147576f3f3

URL: https://github.com/llvm/llvm-project/commit/9964c2c33d750d60b512d518899fa2147576f3f3
DIFF: https://github.com/llvm/llvm-project/commit/9964c2c33d750d60b512d518899fa2147576f3f3.diff

LOG: [MILR][NVVM] Fix missing semicolon in nvvm.barrier.arrive Op (#92769)

This commit fixes the missing semicolon in the PTX codegen path where
barrier id is provided for the NVVM BarrierArriveOp. Also, updated
nvvm-to-llvm.mlir lit test to reflect the same

Co-authored-by: pradeepku <pradeepku at nvidia.com>

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
    mlir/test/Conversion/NVVMToLLVM/nvvm-to-llvm.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
index 7ffbc2d7922f6..4daeeab093863 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
@@ -429,7 +429,7 @@ def NVVM_BarrierArriveOp : NVVM_PTXBuilder_Op<"barrier.arrive">
   let extraClassDefinition = [{
     std::string $cppClass::getPtx() {
       std::string ptx = "bar.arrive ";
-      if (getBarrierId()) { ptx += "%0, %1"; } 
+      if (getBarrierId()) { ptx += "%0, %1;"; } 
       else { ptx += "0, %0;"; }
       return ptx;
     }

diff  --git a/mlir/test/Conversion/NVVMToLLVM/nvvm-to-llvm.mlir b/mlir/test/Conversion/NVVMToLLVM/nvvm-to-llvm.mlir
index 802760f8c899e..1d56ca97b737e 100644
--- a/mlir/test/Conversion/NVVMToLLVM/nvvm-to-llvm.mlir
+++ b/mlir/test/Conversion/NVVMToLLVM/nvvm-to-llvm.mlir
@@ -688,7 +688,7 @@ func.func @fence_proxy() {
 llvm.func @llvm_nvvm_barrier_arrive(%barID : i32, %numberOfThreads : i32) {
   // CHECK: llvm.inline_asm has_side_effects asm_dialect = att "bar.arrive 0, $0;", "r" %[[numberOfThreads]] : (i32) -> ()
   nvvm.barrier.arrive number_of_threads = %numberOfThreads
-  // CHECK: llvm.inline_asm has_side_effects asm_dialect = att "bar.arrive $0, $1", "r,r" %[[barId]], %[[numberOfThreads]] : (i32, i32) -> ()
+  // CHECK: llvm.inline_asm has_side_effects asm_dialect = att "bar.arrive $0, $1;", "r,r" %[[barId]], %[[numberOfThreads]] : (i32, i32) -> ()
   nvvm.barrier.arrive id = %barID number_of_threads = %numberOfThreads
   llvm.return
 }


        


More information about the Mlir-commits mailing list