[Mlir-commits] [mlir] [mlir][linalg] Add pattern to clean unused results after fusion (PR #158627)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Sep 19 06:46:10 PDT 2025


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/ElementwiseOpFusion.cpp
``````````

: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/ElementwiseOpFusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
index f27175a1f..95eda34a7 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
@@ -2227,7 +2227,7 @@ struct DropRedundantResultsFromGenericOps
     OpOperand *resOperand = op.getTiedOpOperand(unusedRes);
     AffineMap map = op.getIndexingMapMatchingResult(unusedRes);
     const unsigned operandIdx = resOperand->getOperandNumber();
-    
+
     // Remove the output operand and add it as an input operand with the same
     // map.
     SmallVector<Value> outs(op.getOutputs());
@@ -2250,7 +2250,7 @@ struct DropRedundantResultsFromGenericOps
     // Replace the remaining results of the old op with the results of the new
     // op.
     rewriter.replaceAllUsesWith(resValues, newGenericOp.getResults());
-    
+
     // Remove the old op.
     rewriter.eraseOp(op);
     return success();

``````````

</details>


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


More information about the Mlir-commits mailing list