[Mlir-commits] [mlir] [arith][mlir] Fixed a bug in CeilDiv with neg values (PR #90855)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu May 2 20:05:31 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 de0abc0983d355bbd971c5c571ba4c209a0c63ea 7214f242e0ccfd5fdd1bad0e1f19bc72c8087d80 -- 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 788d20ca50..61a04f8a24 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -657,7 +657,8 @@ OpFoldResult arith::CeilDivSIOp::fold(FoldAdaptor adaptor) {
         // the quotient down. In essense, Ceil Division with one of the values
         // negative works like a floorDivision with negated quotient.
         // Mathematically, -1 * (abs(a)-1/abs(b) + 1) + 1, which after factoring
-        // out -1 yields -1 * [abs(a)-1/abs(b) + 1 - 1]. This is implemented below.
+        // out -1 yields -1 * [abs(a)-1/abs(b) + 1 - 1]. This is implemented
+        // below.
         APInt posA = aGtZero ? a : zero.ssub_ov(a, overflowOrDiv0);
         APInt posB = bGtZero ? b : zero.ssub_ov(b, overflowOrDiv0);
         APInt div = signedCeilNonnegInputs(posA, posB, overflowOrDiv0);

``````````

</details>


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


More information about the Mlir-commits mailing list