From 0696ad95636c49e653a545a2104aea5ba5a9ce3f Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 10 Jan 2022 23:36:46 +0900 Subject: [PATCH] [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 --- .../ComprehensiveBufferize/ComprehensiveBufferize.h | 2 +- .../ComprehensiveBufferize/ComprehensiveBufferize.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h b/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h index a6b34f8fa643..149c4c60620e 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 69a55b2e49d5..41d4e4fe62e9 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 { - BufferizationPattern(MLIRContext *context, BufferizationState &state, + BufferizationPattern(MLIRContext *context, const BufferizationState &state, PatternBenefit benefit = 1) : OpInterfaceRewritePattern(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(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); }