aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineStableHash.cpp
diff options
context:
space:
mode:
authorMatthias Springer <me@m-sp.org>2024-03-25 18:57:53 +0900
committerGitHub <noreply@github.com>2024-03-25 18:57:53 +0900
commitdbfc38ed6b3f2a9be0b1a86b2a074aad69eb58a6 (patch)
treeced53182b26727bb5f4842221cfd708b29882fed /llvm/lib/CodeGen/MachineStableHash.cpp
parent336bdf1a255571f8d894e8befe4be7e9141f7541 (diff)
downloadllvm-dbfc38ed6b3f2a9be0b1a86b2a074aad69eb58a6.zip
llvm-dbfc38ed6b3f2a9be0b1a86b2a074aad69eb58a6.tar.gz
llvm-dbfc38ed6b3f2a9be0b1a86b2a074aad69eb58a6.tar.bz2
[mlir][bufferization] Add `BufferOriginAnalysis` (#86461)
This commit adds the `BufferOriginAnalysis`, which can be queried to check if two buffer SSA values originate from the same allocation. This new analysis is used in the buffer deallocation pass to fold away or simplify `bufferization.dealloc` ops more aggressively. The `BufferOriginAnalysis` is based on the `BufferViewFlowAnalysis`, which collects buffer SSA value "same buffer" dependencies. E.g., given IR such as: ``` %0 = memref.alloc() %1 = memref.subview %0 %2 = memref.subview %1 ``` The `BufferViewFlowAnalysis` will report the following "reverse" dependencies (`resolveReverse`) for `%2`: {`%2`, `%1`, `%0`}. I.e., all buffer SSA values in the reverse use-def chain that originate from the same allocation as `%2`. The `BufferOriginAnalysis` is built on top of that. It handles only simple cases at the moment and may conservatively return "unknown" around certain IR with branches, memref globals and function arguments. This analysis enables additional simplifications during `-buffer-deallocation-simplification`. In particular, "regular" scf.for loop nests, that yield buffers (or reallocations thereof) in the same order as they appear in the iter_args, are now handled much more efficiently. Such IR patterns are generated by the sparse compiler.
Diffstat (limited to 'llvm/lib/CodeGen/MachineStableHash.cpp')
0 files changed, 0 insertions, 0 deletions