8000 [MLIR] Add bufferization state class to OneShotBufferization pass by mscuttari · Pull Request #138143 · llvm/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

[MLIR] Add bufferization state class to OneShotBufferization pass #138143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add BufferizationState class
  • Loading branch information
mscuttari committed May 17, 2025
commit 0f4b5511a12b0e2c60ba5011310f80dd0b314189
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,19 @@ class AnalysisState {
insideMutuallyExclusiveRegionsCache;
};

/// BufferizationState provides information about the state of the IR during the
/// bufferization process.
class BufferizationState {
public:
/// Get the cached symbol tables.
/// The user is expected to update / invalidate the cached symbol tables if
/// the bufferized operation have the Symbol or SymbolTable traits.
SymbolTableCollection &getSymbolTables();

private:
SymbolTableCollection symbolTables;
};

/// Create an AllocTensorOp for the given shaped value (memref or tensor).
/// If `copy` is set, the shaped value is copied. Otherwise, a tensor with
/// undefined contents is allocated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ void AnalysisState::resetCache() {
insideMutuallyExclusiveRegionsCache.clear();
}

SymbolTableCollection &BufferizationState::getSymbolTables() {
return symbolTables;
}

Region *bufferization::getNextEnclosingRepetitiveRegion(
Region *region, const BufferizationOptions &options) {
assert(isRepetitiveRegion(region, options) && "expected repetitive region");
Expand Down
0