Skip to content

Commit dd6e87b

Browse files
[MLIR][NVVM] Fix lowering logic after fddf7b0 (#170545)
Without this mapping fails when there is no result specified. See: #169922 (comment) To reproduce error on `main`: ```bash mkdir -p build && cd build cmake -G Ninja ../llvm \ -DLLVM_ENABLE_PROJECTS=mlir \ -DLLVM_TARGETS_TO_BUILD="host;NVPTX" \ -DMLIR_ENABLE_CUDA_RUNNER=ON \ -DMLIR_RUN_CUDA_TENSOR_CORE_TESTS=ON \ -DMLIR_RUN_CUDA_SM90_TESTS=ON \ -DMLIR_GPU_COMPILATION_TEST_FORMAT=fatbin \ -DMLIR_INCLUDE_INTEGRATION_TESTS=ON \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_INSTALL_UTILS=ON \ -DCMAKE_BUILD_TYPE=Release ninja bin/mlir-opt ../mlir/test/Integration/GPU/CUDA/sm90/tma_load_128x64_swizzle128b.mlir -gpu-lower-to-nvvm-pipeline="cubin-chip=sm_90 cubin-features=+ptx80 opt-level=3" ```
1 parent 37ea097 commit dd6e87b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,7 @@ def NVVM_MBarrierArriveExpectTxOp : NVVM_PTXBuilder_Op<"mbarrier.arrive.expect_t
948948
auto [id, args] = NVVM::MBarrierArriveExpectTxOp::getIntrinsicIDAndArgs(
949949
*op, moduleTranslation, builder);
950950

951-
int addrSpace = llvm::cast<LLVMPointerType>(op.getAddr().getType()).getAddressSpace();
952-
if (addrSpace != NVVM::NVVMMemorySpace::SharedCluster)
951+
if (op.getNumResults() > 0)
953952
$res = createIntrinsicCall(builder, id, args);
954953
else
955954
createIntrinsicCall(builder, id, args);
@@ -985,9 +984,7 @@ def NVVM_MBarrierArriveDropExpectTxOp : NVVM_Op<"mbarrier.arrive_drop.expect_tx"
985984
string llvmBuilder = [{
986985
auto [id, args] = NVVM::MBarrierArriveDropExpectTxOp::getIntrinsicIDAndArgs(
987986
*op, moduleTranslation, builder);
988-
989-
int addrSpace = llvm::cast<LLVMPointerType>(op.getAddr().getType()).getAddressSpace();
990-
if (addrSpace != NVVM::NVVMMemorySpace::SharedCluster)
987+
if (op.getNumResults() > 0)
991988
$res = createIntrinsicCall(builder, id, args);
992989
else
993990
createIntrinsicCall(builder, id, args);

0 commit comments

Comments
 (0)