Skip to content

Commit 9964c2c

Browse files
[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 <[email protected]>
1 parent 097e96d commit 9964c2c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def NVVM_BarrierArriveOp : NVVM_PTXBuilder_Op<"barrier.arrive">
429429
let extraClassDefinition = [{
430430
std::string $cppClass::getPtx() {
431431
std::string ptx = "bar.arrive ";
432-
if (getBarrierId()) { ptx += "%0, %1"; }
432+
if (getBarrierId()) { ptx += "%0, %1;"; }
433433
else { ptx += "0, %0;"; }
434434
return ptx;
435435
}

mlir/test/Conversion/NVVMToLLVM/nvvm-to-llvm.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ func.func @fence_proxy() {
688688
llvm.func @llvm_nvvm_barrier_arrive(%barID : i32, %numberOfThreads : i32) {
689689
// CHECK: llvm.inline_asm has_side_effects asm_dialect = att "bar.arrive 0, $0;", "r" %[[numberOfThreads]] : (i32) -> ()
690690
nvvm.barrier.arrive number_of_threads = %numberOfThreads
691-
// CHECK: llvm.inline_asm has_side_effects asm_dialect = att "bar.arrive $0, $1", "r,r" %[[barId]], %[[numberOfThreads]] : (i32, i32) -> ()
691+
// CHECK: llvm.inline_asm has_side_effects asm_dialect = att "bar.arrive $0, $1;", "r,r" %[[barId]], %[[numberOfThreads]] : (i32, i32) -> ()
692692
nvvm.barrier.arrive id = %barID number_of_threads = %numberOfThreads
693693
llvm.return
694694
}

0 commit comments

Comments
 (0)