[Mlir-commits] [llvm] [mlir] Add constant propagation for polynomial ops (PR #91655)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu May 9 14:11:09 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 7e59223ac4b045178c287a56154113d5989572f4 04614be503d94506df1b722d9444911337008968 -- mlir/unittests/Dialect/Polynomial/PolynomialMathTest.cpp mlir/include/mlir/Dialect/CommonFolders.h mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h mlir/lib/Dialect/Polynomial/IR/Polynomial.cpp mlir/lib/Dialect/Polynomial/IR/PolynomialAttributes.cpp mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp b/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
index db71e88c86..75827f4351 100644
--- a/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
+++ b/mlir/lib/Dialect/Polynomial/IR/PolynomialOps.cpp
@@ -27,11 +27,13 @@ OpFoldResult ConstantOp::fold(ConstantOp::FoldAdaptor adaptor) {
   PolynomialType ty = dyn_cast<PolynomialType>(getOutput().getType());
 
   if (isa<FloatPolynomialAttr>(ty.getRing().getPolynomialModulus()))
-    return TypedFloatPolynomialAttr::get(ty, cast<FloatPolynomialAttr>(getValue()).getPolynomial());
+    return TypedFloatPolynomialAttr::get(
+        ty, cast<FloatPolynomialAttr>(getValue()).getPolynomial());
 
   assert(isa<IntPolynomialAttr>(ty.getRing().getPolynomialModulus()) &&
          "expected float or integer polynomial");
-  return TypedIntPolynomialAttr::get(ty,cast<IntPolynomialAttr>(getValue()).getPolynomial());
+  return TypedIntPolynomialAttr::get(
+      ty, cast<IntPolynomialAttr>(getValue()).getPolynomial());
 }
 
 OpFoldResult AddOp::fold(AddOp::FoldAdaptor adaptor) {

``````````

</details>


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


More information about the Mlir-commits mailing list