[Mlir-commits] [mlir] 0696ad9 - [mlir][linalg][bufferize][NFC] Pass missing BufferizationState objs as const ref

Matthias Springer llvmlistbot at llvm.org
Mon Jan 10 06:44:16 PST 2022


Author: Matthias Springer
Date: 2022-01-10T23:38:04+09:00
New Revision: 0696ad95636c49e653a545a2104aea5ba5a9ce3f

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

LOG: [mlir][linalg][bufferize][NFC] Pass missing BufferizationState objs as const ref

These should have been updated as part of D116742.

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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
    mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h b/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
index a6b34f8fa643a..149c4c60620e9 100644
--- a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
+++ b/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
@@ -26,7 +26,7 @@ LogicalResult analyzeOp(Operation *op, BufferizationState &state);
 
 /// Bufferize `op` and its nested ops. Bufferization decisions are stored in
 /// `state`.
-LogicalResult bufferizeOp(Operation *op, BufferizationState &state);
+LogicalResult bufferizeOp(Operation *op, const BufferizationState &state);
 
 /// Run Comprehensive Bufferize on the given op: Analysis + Bufferization
 LogicalResult

diff  --git a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
index 69a55b2e49d52..41d4e4fe62e9d 100644
--- a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
+++ b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
@@ -558,7 +558,7 @@ annotateOpsWithBufferizationMarkers(Operation *op,
 /// Rewrite pattern that bufferizes bufferizable ops.
 struct BufferizationPattern
     : public OpInterfaceRewritePattern<BufferizableOpInterface> {
-  BufferizationPattern(MLIRContext *context, BufferizationState &state,
+  BufferizationPattern(MLIRContext *context, const BufferizationState &state,
                        PatternBenefit benefit = 1)
       : OpInterfaceRewritePattern<BufferizableOpInterface>(context, benefit),
         state(state) {}
@@ -646,9 +646,8 @@ mlir::linalg::comprehensive_bufferize::analyzeOp(Operation *op,
   return success();
 }
 
-LogicalResult
-mlir::linalg::comprehensive_bufferize::bufferizeOp(Operation *op,
-                                                   BufferizationState &state) {
+LogicalResult mlir::linalg::comprehensive_bufferize::bufferizeOp(
+    Operation *op, const BufferizationState &state) {
   // Bufferize the op and its nested ops.
   OwningRewritePatternList patterns(op->getContext());
   patterns.add<BufferizationPattern>(op->getContext(), state);
@@ -665,7 +664,5 @@ LogicalResult mlir::linalg::comprehensive_bufferize::runComprehensiveBufferize(
     return failure();
   if (options->testAnalysisOnly)
     return success();
-  if (failed(bufferizeOp(op, state)))
-    return failure();
-  return success();
+  return bufferizeOp(op, state);
 }


        


More information about the Mlir-commits mailing list