[Mlir-commits] [mlir] [mlir][arith] Fix overflow bug in arith::CeilDivSIOp::fold (PR #90947)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri May 3 01:13:28 PDT 2024


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 33e16cae671ca10d88e198192181220f8adff343 c6480bcae235efb91868403aa9577d515aeb3335 -- mlir/lib/Dialect/Arith/IR/ArithOps.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index a89634dfe0..a846f27399 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -711,8 +711,7 @@ OpFoldResult arith::CeilDivSIOp::fold(FoldAdaptor adaptor) {
           APInt posA = zero.ssub_ov(a, overflowNegA);
           APInt posB = zero.ssub_ov(b, overflowNegB);
           APInt res = signedCeilNonnegInputs(posA, posB, overflowDiv);
-          overflowOrDiv0 =
-            (overflowNegA || overflowNegB || overflowDiv);
+          overflowOrDiv0 = (overflowNegA || overflowNegB || overflowDiv);
           return res;
         }
         if (!aGtZero && bGtZero) {

``````````

</details>


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


More information about the Mlir-commits mailing list