[Mlir-commits] [mlir] [mlir] [linalg] Fold broadcast/transpose into linalg.generic (PR #212415)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jul 28 18:11:06 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/Dialect/Linalg/Transforms/FoldIntoElementwise.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/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp b/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
index d7096a642..d6f1727ed 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
@@ -76,15 +76,15 @@ struct FoldIntoElementwisePattern : public OpInterfaceRewritePattern<LinalgOp> {
PatternRewriter &rewriter) const override {
if (!isa<GenericOp, ElementwiseOp>(op.getOperation()) || !isElementwise(op))
return failure();
-
+
bool changed = false;
SmallVector<Value> newIns;
SmallVector<AffineMap> newMaps;
for (OpOperand *operand : op.getDpsInputOperands()) {
AffineMap consumerMap = op.getMatchingIndexingMap(operand);
const bool folded = (ElementwiseOpFolder<ProducerOps>::fold(
- operand, consumerMap, newIns, newMaps) ||
- ...);
+ operand, consumerMap, newIns, newMaps) ||
+ ...);
if (folded) {
changed = true;
} else {
``````````
</details>
https://github.com/llvm/llvm-project/pull/212415
More information about the Mlir-commits
mailing list