Computing Register Pressure

Is there a convenient way to get the number of live intervals at any
program point? Bonus if there's an easy way to iterate through all
of the live intervals at each program point.

Ideally I'd like to give some routine an instruction index and have
it return an iterator to all live intervals at that point.


That's potentially very useful. But the current register allocator is not tracking this. This is something that can be computed at the beginning of allocation but it needs to be updated when spills / spilts happen.