[Mlir-commits] [mlir] [MLIR] Propagate known cluster sizes from gpu.launch to gpu.func (PR #174404)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jan 5 05:36:49 PST 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 h,cpp -- mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp mlir/lib/Dialect/GPU/IR/GPUDialect.cpp mlir/lib/Dialect/GPU/IR/InferIntRangeInterfaceImpls.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/GPUCommon/GPUOpsLowering.cpp b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
index 52dbeea82..498bea0fd 100644
--- a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
+++ b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
@@ -209,8 +209,9 @@ GPUFuncOpLowering::matchAndRewrite(gpu::GPUFuncOp gpuFuncOp, OpAdaptor adaptor,
     attributes.emplace_back(gpuDialect->getKnownGridSizeAttrHelper().getName(),
                             knownGridSize);
   if (knownClusterSize)
-    attributes.emplace_back(gpuDialect->getKnownClusterSizeAttrHelper().getName(),
-                            knownClusterSize);
+    attributes.emplace_back(
+        gpuDialect->getKnownClusterSizeAttrHelper().getName(),
+        knownClusterSize);
 
   // Add a dialect specific kernel attribute in addition to GPU kernel
   // attribute. The former is necessary for further translation while the
diff --git a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
index 47094e91e..a3b2e04c3 100644
--- a/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
+++ b/mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h
@@ -77,7 +77,6 @@ struct GPUFuncOpLoweringOptions {
   /// used.
   StringAttr kernelClusterSizeAttributeName;
 
-
   /// The calling convention to use for kernel functions.
   LLVM::CConv kernelCallingConvention = LLVM::CConv::C;
   /// The calling convention to use for non-kernel functions.
@@ -123,7 +122,6 @@ private:
   /// used.
   StringAttr kernelClusterSizeAttributeName;
 
-
   /// The calling convention to use for kernel functions
   LLVM::CConv kernelCallingConvention;
   /// The calling convention to use for non-kernel functions
diff --git a/mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp b/mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp
index dd05c9133..01b343376 100644
--- a/mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp
+++ b/mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp
@@ -533,8 +533,8 @@ void populateGpuToLLVMSPVConversionPatterns(
       GPUFuncOpLoweringOptions{
           privateAddressSpace, localAddressSpace,
           /*kernelAttributeName=*/{}, kernelBlockSizeAttributeName,
-          /*kernelClusterSizeAttributeName=*/{},
-          LLVM::CConv::SPIR_KERNEL, LLVM::CConv::SPIR_FUNC,
+          /*kernelClusterSizeAttributeName=*/{}, LLVM::CConv::SPIR_KERNEL,
+          LLVM::CConv::SPIR_FUNC,
           /*encodeWorkgroupAttributionsAsArguments=*/true});
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/174404


More information about the Mlir-commits mailing list