[Mlir-commits] [mlir] [mlir][gpu] Add gpu.ballot operation to GPU dialect (PR #188647)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 25 17:53:16 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/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp mlir/lib/Dialect/GPU/IR/GPUDialect.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/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index ab7a0c775..f3768decb 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -548,8 +548,8 @@ LogicalResult GPUBallotConversion::matchAndRewrite(
     Value lowExt = spirv::UConvertOp::create(rewriter, loc, i64Type, low);
     Value highExt = spirv::UConvertOp::create(rewriter, loc, i64Type, high);
     // Shift high left by 32 bits.
-    Value shift = spirv::ConstantOp::create(
-        rewriter, loc, i64Type, rewriter.getI64IntegerAttr(32));
+    Value shift = spirv::ConstantOp::create(rewriter, loc, i64Type,
+                                            rewriter.getI64IntegerAttr(32));
     Value highShifted =
         spirv::ShiftLeftLogicalOp::create(rewriter, loc, highExt, shift);
     // Combine with bitwise OR.

``````````

</details>


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


More information about the Mlir-commits mailing list