On Fri, May 18, 2018 at 1:57 PM Bin.Cheng <amker.ch...@gmail.com> wrote:
> On Fri, May 4, 2018 at 5:23 PM, Bin Cheng <bin.ch...@arm.com> wrote: > > Hi, > > Based on previous patch, this one implements live range, reg pressure computation > > class in tree-ssa-live.c. The user would only need to instantiate the class and > > call the computation interface as in next patch. > > During the work, I think it's also worthwhile to classify all live range and coalesce > > data structures and algorithms in the future. > > > > Bootstrap and test on x86_64 and AArch64 ongoing. Any comments? > Updated patch in line with change of previous patch. So I see you do not want to expose the magic '16' in pressure_threshold to the user because in theory the target should provide enough information. But why need it at all? Also + /* Calculate maximum reg pressure information for region and store it in + MAX_PRESSURE. Return true if the reg pressure is high. */ + bool calculate_pressure (unsigned *max_pressure); it looks like you expect a [N_REG_CLASSES] sized output array here, that's not clear from the documentation. The output information is a little shallow - I'd be interested in the number of live through region regs being separated from live in / out. That is, can you add additional outputs to the above and thus make it more like bool calculate_pressure (unsigned max_pressure[], unsigned live_in[], unsigned live_out[], unsigned live_through[]); with the numbers being on the region? It also seems to be a fire-and-forget class so I wonder why liveness is not computed at construction time so intermediate data can be freed and only the results stored? stmt_lr_info -> id seems to be unused? In fact what is the point of this structure (and the per stmt bitmap)? It looks write-only to me... Thanks and sorry for the delay in review. Richard. > Thanks, > bin > > > > Thanks, > > bin > > 2018-04-27 Bin Cheng <bin.ch...@arm.com> > > > > * tree-ssa-live.c (memmodel.h, ira.h, tree-ssa-coalesce.h): Include. > > (struct stmt_lr_info, free_stmt_lr_info): New. > > (lr_region::lr_region, lr_region::~lr_region): New. > > (lr_region::create_stmt_lr_info): New. > > (lr_region::update_live_range_by_stmt): New. > > (lr_region::calculate_coalesced_pressure): New. > > (lr_region::calculate_pressure): New. > > * tree-ssa-live.h (struct stmt_lr_info): New declaration. > > (class lr_region): New class.