[nll] only compute liveness for variables whose types include regions #52034
Labels
A-NLL
Area: Non-lexical lifetimes (NLL)
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
NLL-performant
Working towards the "performance is good" goal
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Looking more at the tuple-stress benchmark, @nnethercote and I were thinking that one way to speed it up -- and possibly others as well! -- would be to tweak the liveness code. Instead of computing the liveness of all variables, for the purposes of NLL we only need to compute the liveness for variables whose types include regions. We could use the same flag mechanism described in #52027 to modify the liveness code and skip those variables whose types do not have any free regions.
To do this, we'd have to modify the liveness code. I imagine something like this:
Local
if you are using all locals, but possibly something else otherwise. It would take some kind ofLocal -> Option<N>
map.IndexVec<Local, Option<RegionLocal>>
mapping to the compressed id, and oneIndexVec<RegionLocal, Local>
mapping back to the original id.RegionLocal
which we would map back.The text was updated successfully, but these errors were encountered: