aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
diff options
context:
space:
mode:
authorBilly Zhu <billyzhu@modular.com>2024-04-08 01:09:54 -0700
committerGitHub <noreply@github.com>2024-04-08 01:09:54 -0700
commit81a7b6454e195f2051b76d9e5b1f0c430df0f502 (patch)
tree188f0d4cf167437ac18a7520f85955314805cd4f /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
parent9fd2e2c2fd0dbd5d11a5899bd6bb4db0fd3f2c35 (diff)
downloadllvm-81a7b6454e195f2051b76d9e5b1f0c430df0f502.zip
llvm-81a7b6454e195f2051b76d9e5b1f0c430df0f502.tar.gz
llvm-81a7b6454e195f2051b76d9e5b1f0c430df0f502.tar.bz2
[MLIR][LLVM] Recursion importer handle repeated self-references (#87295)
Followup to this discussion: https://github.com/llvm/llvm-project/pull/80251#discussion_r1535599920. The previous debug importer was correct but inefficient. For cases with mutual recursion that contain more than one back-edge, each back-edge would result in a new translated instance. This is because the previous implementation never caches any translated result with unbounded self-references. This means all translation inside a recursive context is performed from scratch, which will incur repeated run-time cost as well as repeated attribute sub-trees in the translated IR (differing only in their `recId`s). This PR refactors the importer to handle caching inside a recursive context. - In the presence of unbound self-refs, the translation result is cached in a separate cache that keeps track of the set of dependent unbound self-refs. - A dependent cache entry is valid only when all the unbound self-refs are in scope. Whenever a cached entry goes out of scope, it will be removed the next time it is looked up.
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions