summaryrefslogtreecommitdiff
path: root/mlir/lib/Interfaces/MemorySlotInterfaces.cpp
AgeCommit message (Collapse)Author
2023-05-22[mlir] Add a generic SROA implementation.Théo Degioanni
This revision introduces a generic implementation of Scalar Replacement Of Aggregates. In contrast to the implementation in LLVM, this focuses on the core of SROA: destructuring aggregates. By implementing interfaces on allocators and accessors, memory allocators can be destructured into smaller allocators, through the MemorySlot abstraction. This pass only works on aggregates that are accessed in a "type-safe" way, that is within the bounds and respecting the type of a given memory slot. The destructuring pattern and functions only peel off the first layer of aggregates and can safely be applied repeatedly. For convenience, the transformation is also available as a pass that will apply the pattern repeatedly. Depends on D149958 Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D150186
2023-05-09Reland "[mlir][mem2reg] Expose algorithm internals."Théo Degioanni
This patch refactors the Mem2Reg infrastructure. It decouples analysis from promotion, allowing for more control over the execution of the logic. It also adjusts the interfaces to be less coupled to mem2reg and more general. This will be useful for an upcoming revision introducing generic SROA. This commit reverts f333977eb20a and relands 91cff8a71872. The original commit was reverted accidentally due to a misinterpretation of a bazel build bot failure. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D149825
2023-05-08Revert "[mlir][mem2reg] Expose algorithm internals."Tobias Gysi
The commit causes build bot failures due to a missing dependencies: https://buildkite.com/llvm-project/llvm-main/builds/7036#0187fb40-e4b6-4471-a2a0-2820b71c727b This reverts commit 91cff8a71872cf49f0c5c9e5510f8065bfefa3c3.
2023-05-08[mlir][mem2reg] Expose algorithm internals.Théo Degioanni
This patch refactors the Mem2Reg infrastructure. It decouples analysis from promotion, allowing for more control over the execution of the logic. It also adjusts the interfaces to be less coupled to mem2reg and more general. This will be useful for an upcoming revision introducing generic SROA. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D149825