Lazily cache the feature components of a LiveInterval.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Gentle reminder - I don't think this change is too controversial, but lmk if advisors owning VRAIs seems too gauche.
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp | ||
---|---|---|
252–255 | Isn't this only ever computed once per live interval? I don't see any code computing this a 2nd time making it necessary to invalidate a cache... The only user of this function is VirtRegAuxInfo::calculateSpillWeightsAndHints computing the initial spill weights when initializing the regalloc; and LiveRangeEdit::calculateRegClassAndHint which calls this function only for the newly created live intervals. Why would you need to invalidate a cache then? |
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp | ||
---|---|---|
252–255 | Oh, true - so much simpler. (separately, I wonder if I can remove setWeight and just ctor the LI with it pre-calculated) |
Isn't this only ever computed once per live interval? I don't see any code computing this a 2nd time making it necessary to invalidate a cache...
The only user of this function is VirtRegAuxInfo::calculateSpillWeightsAndHints computing the initial spill weights when initializing the regalloc; and LiveRangeEdit::calculateRegClassAndHint which calls this function only for the newly created live intervals.
Why would you need to invalidate a cache then?