[Mlir-commits] [mlir] [mlir][NVVM] Add InferTypeOpInterface to NVVM ops with deterministic result types (PR #188173)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Mar 25 03:12:01 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp b/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
index e50db175e..3da46e9c9 100644
--- a/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
+++ b/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
@@ -909,10 +909,10 @@ struct NVGPUMBarrierArriveExpectTxLowering
getMbarrierPtr(b, op.getBarriers().getType(), adaptor.getBarriers(),
adaptor.getMbarId(), rewriter);
Value txcount = truncToI32(b, adaptor.getTxcount());
- NVVM::MBarrierArriveExpectTxOp::create(rewriter, op->getLoc(),
- barrier, txcount, // barrier and txcount
- NVVM::MemScopeKind::CTA, // default scope is CTA
- false, // relaxed-semantics is false
+ NVVM::MBarrierArriveExpectTxOp::create(
+ rewriter, op->getLoc(), barrier, txcount, // barrier and txcount
+ NVVM::MemScopeKind::CTA, // default scope is CTA
+ false, // relaxed-semantics is false
adaptor.getPredicate());
rewriter.eraseOp(op);
return success();
diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index c38f66587..17854b4bb 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -308,9 +308,9 @@ LogicalResult MBarrierArriveDropExpectTxOp::verify() {
/// Only shared_cluster (ptr<7>) produces zero results; all other address
/// spaces (including generic) return i64.
-static LogicalResult inferMBarrierArriveResultTypes(
- MLIRContext *context, Value addr,
- SmallVectorImpl<Type> &inferredReturnTypes) {
+static LogicalResult
+inferMBarrierArriveResultTypes(MLIRContext *context, Value addr,
+ SmallVectorImpl<Type> &inferredReturnTypes) {
auto ptrTy = llvm::cast<LLVM::LLVMPointerType>(addr.getType());
if (ptrTy.getAddressSpace() !=
static_cast<unsigned>(NVVMMemorySpace::SharedCluster))
@@ -318,10 +318,11 @@ static LogicalResult inferMBarrierArriveResultTypes(
return success();
}
-LogicalResult MBarrierArriveOp::inferReturnTypes(
- MLIRContext *context, std::optional<Location> location,
- MBarrierArriveOp::Adaptor adaptor,
- SmallVectorImpl<Type> &inferredReturnTypes) {
+LogicalResult
+MBarrierArriveOp::inferReturnTypes(MLIRContext *context,
+ std::optional<Location> location,
+ MBarrierArriveOp::Adaptor adaptor,
+ SmallVectorImpl<Type> &inferredReturnTypes) {
return inferMBarrierArriveResultTypes(context, adaptor.getAddr(),
inferredReturnTypes);
}
@@ -2877,8 +2878,7 @@ LogicalResult NVVM::BarrierOp::verify() {
LogicalResult BarrierOp::inferReturnTypes(
MLIRContext *context, std::optional<Location> location,
- BarrierOp::Adaptor adaptor,
- SmallVectorImpl<Type> &inferredReturnTypes) {
+ BarrierOp::Adaptor adaptor, SmallVectorImpl<Type> &inferredReturnTypes) {
if (adaptor.getReductionOp())
inferredReturnTypes.push_back(IntegerType::get(context, 32));
return success();
``````````
</details>
https://github.com/llvm/llvm-project/pull/188173
More information about the Mlir-commits
mailing list