On Wed, Sep 12, 2018 at 2:56 PM Kyrill Tkachov
<kyrylo.tkac...@foss.arm.com> wrote:
>
> Hi all,
>
> This PR is an SSA validation error where the definition ends up not 
> dominating a use.
> This appeared after my recip_sqrt optimisation. Though the optimisation 
> doesn't get triggered
> as there is no sqrt involved it prevents execute_cse_reciprocals_1 from 
> running as it's currently
> an either/or situation. I think execute_cse_reciprocals_1 doesn't like it 
> when some divisions get
> execute_cse_reciprocals_1 called on them and some don't.
>
> This patch changes optimize_recip_sqrt to return a boolean indicating success 
> and call execute_cse_reciprocals_1
> if no transform was made so that execute_cse_reciprocals_1 has a chance to 
> optimise it as well.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
> Ok for trunk?

OK.  But your analysis suggests to do it the other way around - call
execute_cse_reciprocals_1 and if that
leaves a division at *gsi process it with optimize_recip_sqrt?

Richard.

> Thanks,
> Kyrill
>
> 2018-09-12  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>
>
>      PR tree-optimization/87259
>      PR lto/87283
>      * tree-ssa-math-opts.c (optimize_recip_sqrt): Make function return
>      boolean.
>      (pass_cse_reciprocals::execute): Try execute_cse_reciprocals_1 if
>      optimize_recip_sqrt was ineffective.
>
> 2018-09-12  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>
>
>      PR tree-optimization/87259
>      * gcc.dg/pr87259.c: New test.

Reply via email to