On Wed, Sep 12, 2018 at 6:25 PM Kyrill Tkachov <kyrylo.tkac...@foss.arm.com> wrote: > > > On 12/09/18 15:51, Richard Biener wrote: > > 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? > > > > Ah, that's a shorter approach, this version implements that. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > Is this preferable?
Yes. OK for trunk. Richard. > Thanks, > Kyrill > > 2018-09-12 Kyrylo Tkachov <kyrylo.tkac...@arm.com> > > PR tree-optimization/87259 > PR lto/87283 > (pass_cse_reciprocals::execute): Run optimize_recip_sqrt after > execute_cse_reciprocals_1 has tried transforming. > > 2018-09-12 Kyrylo Tkachov <kyrylo.tkac...@arm.com> > > PR tree-optimization/87259 > * gcc.dg/pr87259.c: New test. >