Skip to content

Commit 01ac180

Browse files
authored
[mlir][nvvm] Fix mov.u32 to mov.pred (#70027)
This PR fixes the incorrect `mov` instruction in PTX. We actually move a predicate here, not u32, so the correct instruction should be `mov.pred`.
1 parent 006cd37 commit 01ac180

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ def NVVM_ElectSyncOp : NVVM_Op<"elect.sync",
469469
"{ \n"
470470
".reg .u32 rx; \n"
471471
".reg .pred px; \n"
472-
" mov.u32 %0, 0; \n"
472+
" mov.pred %0, 0; \n"
473473
" elect.sync rx | px, 0xFFFFFFFF;\n"
474-
"@px mov.u32 %0, 1; \n"
474+
"@px mov.pred %0, 1; \n"
475475
"}\n"
476476
);
477477
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ func.func @elect_one_leader_sync() {
497497
// CHECK: llvm.inline_asm has_side_effects asm_dialect = att "{
498498
// CHECK-SAME: .reg .u32 rx;
499499
// CHECK-SAME: .reg .pred px;
500-
// CHECK-SAME: mov.u32 $0, 0;
500+
// CHECK-SAME: mov.pred $0, 0;
501501
// CHECK-SAME: elect.sync rx | px, 0xFFFFFFFF;
502-
// CHECK-SAME: @px mov.u32 $0, 1;
502+
// CHECK-SAME: @px mov.pred $0, 1;
503503
// CHECK-SAME: "=b" : () -> i1
504504
%cnd = nvvm.elect.sync -> i1
505505
return

0 commit comments

Comments
 (0)