[Mlir-commits] [mlir] 26b3e92 - [mlir][Linalg] Don't return early from inPlaceAnalysis

Nicolas Vasilache llvmlistbot at llvm.org
Wed Oct 6 03:09:53 PDT 2021


Author: Nicolas Vasilache
Date: 2021-10-06T10:03:25Z
New Revision: 26b3e929811814a4d2698228d1e8ded90b8bad7b

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

LOG: [mlir][Linalg] Don't return early from inPlaceAnalysis

Instead just emit a warning that analysis failed and the result will be treated conservatively.

Differential Revision: https://reviews.llvm.org/D111217

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
index aba7d108e38a6..0e3ce47eca3e0 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
@@ -2299,19 +2299,17 @@ LogicalResult mlir::linalg::inPlaceAnalysis(SmallVector<Operation *> &ops,
         if (result.getType().isa<TensorType>() &&
             failed(bufferizableInPlaceAnalysis(opOperand, result, aliasInfo,
                                                domInfo)))
-          return failure();
+          op->emitWarning() << "Inplace analysis treated conservatively";
     }
     // Special logic to analyze ExtractSliceOp.
     // Note that ExtractSliceOp analysis needs to be interleaved with other ops
     // to properly capture aliases.
     // Walk ExtractSliceOps in reverse for better clobbering analysis behavior:
     // it is easier to detect clobbers of smaller slices before larger ones.
-    if (auto extractSliceOp = dyn_cast<ExtractSliceOp>(op)) {
+    if (auto extractSliceOp = dyn_cast<ExtractSliceOp>(op))
       if (failed(
               bufferizableInPlaceAnalysis(extractSliceOp, aliasInfo, domInfo)))
-        return failure();
-      continue;
-    }
+        op->emitWarning() << "Inplace analysis treated conservatively";
   }
   return success();
 }


        


More information about the Mlir-commits mailing list