[PATCH] PR23948 et al., take 2

Diego Novillo dnovillo@redhat.com
Tue Jan 10 13:25:00 GMT 2006


On Monday 09 January 2006 00:33, Paolo Bonzini wrote:

>         PR tree-optimization/23109
>         PR tree-optimization/23948
>         PR tree-optimization/24123
>
>         * Makefile.in (tree-ssa-math-opts.o): Adjust dependencies.
>         * tree-cfg.c (single_noncomplex_succ): New.
>         * tree-flow.h (single_noncomplex_succ): Declare it.
>         * tree-ssa-math-opts.c (enum place_reciprocal): Remove.
>         * tree-ssa-math-opts.c (enum place_reciprocal): Remove.
>         (struct occurrence, occ_head, occ_pool, is_divide_by,
> compute_merit, insert_bb, register_division_in, insert_reciprocals,
>         replace_reciprocal, free_bb): New.
>         (execute_cse_reciprocals_1): Rewritten.
>         (execute_cse_reciprocals): Adjust calls to
> execute_cse_reciprocals_1. Do not commit any edge insertion.  Always
> compute dominators and create the allocation pool.
>         * params.def (PARAM_MIN_DIVISIONS_FOR_RECIP_MUL): New.
>         * params.h (MIN_DIVISIONS_FOR_RECIP_MUL): New.
>         * passes.c (init_optimization_passes): Run recip after tree loop
>         optimizations.
>         * doc/invoke.texi (--param): Add the min-divisions-for-recip-mul
>         parameter.
>
OK, but I agree with Ian: --param min-divisions-for-recip-mul ought to be a 
target hook, not a --param.  No need to resubmit the patch.  Once you make 
it a target hook, the patch can go in.

Another minor point.  Should the gate function trigger only for -O2 and up?  
I don't feel too strongly about it because this optimization shouldn't 
obfuscate the code too much.



More information about the Gcc-patches mailing list