[Mlir-commits] [mlir] b09e6b9 - Fix two warnings introduced by 69011a2ad0ce "[mlir][Linalg] Make Elementwise op fusion return a map from existing values to values in the fused op." (NFCI)

Jorge Gorbe Moya llvmlistbot at llvm.org
Tue Jan 31 13:52:07 PST 2023


Author: Jorge Gorbe Moya
Date: 2023-01-31T13:51:33-08:00
New Revision: b09e6b9810dc542eec3acd9f74d84423ca349a96

URL: https://github.com/llvm/llvm-project/commit/b09e6b9810dc542eec3acd9f74d84423ca349a96
DIFF: https://github.com/llvm/llvm-project/commit/b09e6b9810dc542eec3acd9f74d84423ca349a96.diff

LOG: Fix two warnings introduced by 69011a2ad0ce "[mlir][Linalg] Make Elementwise op fusion return a map from existing values to values in the fused op." (NFCI)

- a -Wunused-result from ignoring a LogicalResult return value.
- an unused variable

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
index 8df324dfa381..a15d657681c5 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
@@ -425,10 +425,9 @@ class FuseElementwiseOps : public OpRewritePattern<GenericOp> {
       FailureOr<ElementwiseOpFusionResult> fusionResult =
           fuseElementwiseOps(rewriter, &opOperand);
       if (failed(fusionResult))
-        rewriter.notifyMatchFailure(genericOp, "fusion failed");
+        return rewriter.notifyMatchFailure(genericOp, "fusion failed");
       Operation *producer = opOperand.get().getDefiningOp();
       for (auto [origVal, replacement] : fusionResult->replacements) {
-        Value origValCopy = origVal;
         rewriter.replaceUseIf(origVal, replacement, [&](OpOperand &use) {
           // Only replace consumer uses.
           return use.get().getDefiningOp() != producer;


        


More information about the Mlir-commits mailing list