[Mlir-commits] [mlir] [mlir][arith] Fix canon pattern for large ints in chained arith (PR #68900)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Oct 12 08:24:36 PDT 2023
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 a574ef61766d49db4350b6f06a108f36bccb25bb ddbde18e483d12485ba25c715e8a94480b9d6dcf -- 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 25578b1c52f3..3ed74a723395 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -38,8 +38,7 @@ using namespace mlir::arith;
static IntegerAttr
applyToIntegerAttrs(PatternRewriter &builder, Value res, Attribute lhs,
- Attribute rhs,
- function_ref<APInt(APInt, APInt&)> binFn) {
+ Attribute rhs, function_ref<APInt(APInt, APInt &)> binFn) {
auto lhsVal = llvm::cast<IntegerAttr>(lhs).getValue();
auto rhsVal = llvm::cast<IntegerAttr>(rhs).getValue();
auto value = binFn(lhsVal, rhsVal);
@@ -48,25 +47,19 @@ applyToIntegerAttrs(PatternRewriter &builder, Value res, Attribute lhs,
static IntegerAttr addIntegerAttrs(PatternRewriter &builder, Value res,
Attribute lhs, Attribute rhs) {
- auto binFn = [](APInt a, APInt& b) -> APInt {
- return std::move(a) + b;
- };
+ auto binFn = [](APInt a, APInt &b) -> APInt { return std::move(a) + b; };
return applyToIntegerAttrs(builder, res, lhs, rhs, binFn);
}
static IntegerAttr subIntegerAttrs(PatternRewriter &builder, Value res,
Attribute lhs, Attribute rhs) {
- auto binFn = [](APInt a, APInt& b) -> APInt {
- return std::move(a) - b;
- };
+ auto binFn = [](APInt a, APInt &b) -> APInt { return std::move(a) - b; };
return applyToIntegerAttrs(builder, res, lhs, rhs, binFn);
}
static IntegerAttr mulIntegerAttrs(PatternRewriter &builder, Value res,
Attribute lhs, Attribute rhs) {
- auto binFn = [](APInt a, APInt& b) -> APInt {
- return std::move(a) * b;
- };
+ auto binFn = [](APInt a, APInt &b) -> APInt { return std::move(a) * b; };
return applyToIntegerAttrs(builder, res, lhs, rhs, binFn);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/68900
More information about the Mlir-commits
mailing list