Here's another performance patch for InstrRefBasedLDV: rather than processing all variable values in a scope at a time, instead, process one variable at a time. The benefits are twofold:
- It's easier to reason about one variable at a time in your mind,
- This recovers some recent lost performance [0].
I think the performance benefit comes from less work being done: if there are several variables in a lexical scope, and only one of them has a value that changes, then all them get reprocessed. This way we're keeping the locality benefits, but doing less work. Plus, we're dealing with fewer DenseMap lookups.
The downside is that the value-propagation part of variable value calculations is now indented one level further., plus the unit tests all get re-written a bit.
The part of the comment after the colon seems redundant now?