[PATCH] D148109: [mlir] Add a generic mem2reg implementation.
Théo Degioanni via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 01:42:18 PDT 2023
Moxinilian marked 4 inline comments as done.
Moxinilian added inline comments.
================
Comment at: mlir/include/mlir/Interfaces/Mem2RegInterfaces.td:27
+ whether the slot pointer is properly used or not. This allocator is the
+ "owner" of the returned slots, meaning no two allocators should return
+ the same slot. The content of the memory slot must only be reachable
----------------
Moxinilian wrote:
> Mogball wrote:
> > Couldn't you assert that the slot is a result of the operation in question? Then it is impossible for more than one operation to return the same slot.
> There are legitimate reasons for that to not be the case even though this pass supports it. For example, one could design their allocating operations using regions, if they need interesting lifetime control. Example:
> ```
> dialect.region_alloca {
> ^bb0(%slot: ptr<i32>):
> // ...
> }
> ```
> In that case, the slot is not a result of the allocator.
I now assert that the block is either a result or an argument of one of its regions. Those seems like the only reasonable options anyway (if one needs something else, they should define the interface on the operation that actually generates the slot).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148109/new/
https://reviews.llvm.org/D148109
More information about the llvm-commits
mailing list