[Mlir-commits] [mlir] 2fc19f8 - [mlir][bufferization] Expose checkPreBufferizationAssumptions helper (#221302)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Sep 10 14:04:27 PDT 2026
Author: Colin De Vlieghere
Date: 2026-09-10T14:04:22-07:00
New Revision: 2fc19f8c9d70209bada5249632fd0d2523a59952
URL: https://github.com/llvm/llvm-project/commit/2fc19f8c9d70209bada5249632fd0d2523a59952
DIFF: https://github.com/llvm/llvm-project/commit/2fc19f8c9d70209bada5249632fd0d2523a59952.diff
LOG: [mlir][bufferization] Expose checkPreBufferizationAssumptions helper (#221302)
Downstream users of bufferization may want to run this check without
invoking the entire one-shot module analysis. If the check is not run
and invalid IR is encountered, OneShotBufferize tends to crash rather
than emitting a nice error message.
This patch simply exposes `checkPreBufferizationAssumptions` to the
header file so it is accessible to other users.
Added:
Modified:
mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h
mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h b/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h
index 34ce4fe456199..49706c5614d83 100644
--- a/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h
+++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h
@@ -272,6 +272,12 @@ class OneShotAnalysisState : public AnalysisState {
DenseMap<TypeID, std::unique_ptr<Extension>> extensions;
};
+/// Perform various checks on the input IR to see if it contains IR constructs
+/// that are unsupported by One-Shot Bufferize.
+LogicalResult checkPreBufferizationAssumptions(Operation *op,
+ const DominanceInfo &domInfo,
+ OneShotAnalysisState &state);
+
/// Analyze `op` and its nested ops. Bufferization decisions are stored in
/// `state`.
LogicalResult analyzeOp(Operation *op, OneShotAnalysisState &state,
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
index 937a765d49ad8..e948a02cc415d 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
@@ -1185,11 +1185,8 @@ LogicalResult OneShotAnalysisState::analyzeOp(Operation *op,
return success();
}
-/// Perform various checks on the input IR to see if it contains IR constructs
-/// that are unsupported by One-Shot Bufferize.
-static LogicalResult
-checkPreBufferizationAssumptions(Operation *op, const DominanceInfo &domInfo,
- OneShotAnalysisState &state) {
+LogicalResult bufferization::checkPreBufferizationAssumptions(
+ Operation *op, const DominanceInfo &domInfo, OneShotAnalysisState &state) {
const BufferizationOptions &options = state.getOptions();
// Note: This walk cannot be combined with the one below because interface
More information about the Mlir-commits
mailing list