> For balanced and max partitioning this adds proper partitioning of asm
> and related symbols.
> 
> The special symbols are partitioned with 1to1 and joined together if
> there is no name conflict. All other symbols are partitioned with the
> requested partitioning.
> In typical usage with small number of toplevel assembly and no name
> conflicts, all special symbols will be in the single first partition.
> balanced partitioning will continue filling last asm partition.
> 
> gcc/lto/ChangeLog:
> 
>       * lto-partition.cc (join_partitions): Declare.
>       (lto_1_to_1_map): Split out to..
>       (map_1_to_1): ..here.
>       (symbol_nonrenameable): New.
>       (create_asm_partition): Replaced by..
>       (create_asm_partitions): ..this.
>       (lto_max_map): Use new create_asm_partitions.
>       (lto_balanced_map): Use new create_asm_partitions.
> 
> gcc/testsuite/ChangeLog:
> 
>       * gcc.dg/lto/toplevel-extended-asm-2_0.c: More partitionings.
>       * gcc.dg/lto/toplevel-extended-asm-2_1.c: Likewise.

> +/* There may be some rare false positives since we do not have another
> +   flag to track this nonrenameability directly.  */
> +static bool
> +symbol_nonrenameable (symtab_node* node)
> +{
> +  return (node->must_remain_in_tu && node->ref_by_asm
> +       && !TREE_PUBLIC (node->decl));

If must_remain_in_tu is used to mark funcitons/variables referring to
non-renameable symbols then I think either the predicate is misnamed or
should not test this flag them?

Also new Jakub's toplevel asm should support renaming.  Will these have
ref_by_asm flag?

Honza

Reply via email to