Hi Juzhe, I think the general approach makes sense and it doesn't need to be perfect from the beginning as we can always iterate on it. Before continuing with a more detailed review (hopefully tomorrow) some high-level questions upfront. It would help to document some of these choices so it's easier to understand the rationale.
- Why don't we use the normal reverse postorder (or postorder) approach of computing live ranges? Is that because we don't really need full global live ranges? - Why can't we use existing code i.e. tree-ssa-live? I suspect I already know the answer but an explanation (in a comment) would still be useful. - Do we really need get_all_predecessors/get_all_successors? As they're only used for "defined before" and "used after", at first glance it looks like some kind of dominance info could help there but I didn't really check in detail. - Why don't we use bitmaps/sbitmaps like in vsetvl.cc and other related passes? I don't mind maps but just wonder if it's on purpose, for convenience or something else. Besides, it might help to rename program_points_map (into program_points_per_bb or so). At first it looked quadratic to me but we're just iterating over the program points of a BB. Regards Robin