On Fri, May 4, 2018 at 6:23 PM, Bin Cheng <bin.ch...@arm.com> wrote:
> Hi,
> Following Jeff's suggestion, I am now using existing tree-ssa-live.c and
> tree-ssa-coalesce.c to compute register pressure, rather than inventing
> another live range solver.
>
> The major change is to record region's basic blocks in var_map and use that
> information in computation, rather than FOR_EACH_BB_FN.  For now only loop
> and function type regions are supported.  The default one is function type
> region which is used in out-of-ssa.  Loop type region will be used in next
> patch to compute information for a loop.
>
> Bootstrap and test on x86_64 and AArch64 ongoing.  Any comments?

I believe your changes to create_outofssa_var_map should be done differently
by simply only calling it from the coalescing context and passing in the
var_map rather than initializing it therein and returning it.

This also means the coalesce_vars_p flag in the var_map structure looks
somewhat out-of-place.  That is, it looks you could do with many less
changes if you refactored what calls what slightly?  For example
the extra arg to gimple_can_coalesce_p looks unneeded.

Just as a note I do have a CFG helper pending that computes RPO order
for SEME regions (attached).  loops are SEME regions, so your RTYPE_SESE
is somewhat odd - I guess RTYPE_LOOP exists only because of the
convenience of passing in a loop * to the "constructor".  I'd rather
drop this region_type thing and always assume a SEME region - at least
I didn't see anything in the patch that depends on any of the forms
apart from the initial BB gathering.

Thanks,
Richard.



> Thanks,
> bin
> 2018-04-27  Bin Cheng  <bin.ch...@arm.com>
>
>         * tree-outof-ssa.c (remove_ssa_form): Update use.
>         * tree-ssa-coalesce.c (build_ssa_conflict_graph): Support regional
>         coalesce.
>         (coalesce_with_default): Update comment.
>         (create_outofssa_var_map): Support regional coalesce.  Rename to...
>         (create_var_map): ...this.
>         (coalesce_partitions): Support regional coalesce.
>         (gimple_can_coalesce_p, compute_optimized_partition_bases): Ditto.
>         (coalesce_ssa_name): Ditto.
>         * tree-ssa-coalesce.h (coalesce_ssa_name, gimple_can_coalesce_p):
>         Add parameter in declarations.
>         * tree-ssa-live.c (init_var_map, delete_var_map): Support regional
>         coalesce.
>         (new_tree_live_info, loe_visit_block, set_var_live_on_entry): Ditto.
>         (calculate_live_on_exit, verify_live_on_entry): Ditto.
>         * tree-ssa-live.h (enum region_type): New.
>         (struct _var_map): New fields.
>         (init_var_map): Add parameter in declaration.
>         (function_region_p, region_contains_p): New.
>         * tree-ssa-uncprop.c (uncprop_into_successor_phis): Update uses.

Attachment: p
Description: Binary data

Reply via email to