This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR85787: Extend malloc_candidate_p to handle multiple phis.
- From: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Thu, 4 Oct 2018 16:38:51 +0530
- Subject: Re: PR85787: Extend malloc_candidate_p to handle multiple phis.
- References: <CAAgBjMmdps8GYfKX9-6BTSBZ_7ci++xJZ8sfB1=DNyqzEUwX+g@mail.gmail.com> <2ac94917-2ae5-4dde-295b-f6d7a136943f@redhat.com>
On Fri, 14 Sep 2018 at 22:49, Jeff Law <law@redhat.com> wrote:
>
> On 8/28/18 5:26 AM, Prathamesh Kulkarni wrote:
> > H
> > The attached patch extends malloc_candidate_p to handle multiple phis.
> > There's a lot of noise in the patch because I moved most of
> > malloc_candidate_p into
> > new function malloc_candidate_p_1. The only real change is following hunk:
> >
> > + gimple *arg_def = SSA_NAME_DEF_STMT (arg);
> > + if (is_a<gphi *> (arg_def))
> > + {
> > + if (!malloc_candidate_p_1 (fun, arg, phi, ipa))
> > + DUMP_AND_RETURN ("nested phi fail")
> > + continue;
> > + }
> > +
> >
> > Which checks recursively that the phi argument is used only within
> > comparisons against 0
> > and the phi.
> >
> > Bootstrapped+tested on x86_64-unknown-linux-gnu.
> > OK to commit ?
> >
> > Thanks,
> > Prathamesh
> >
> >
> > pr85787-1.txt
> >
> > 2018-08-28 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
> >
> > PR tree-optimization/85787
> > * ipa-pure-const.c (malloc_candidate_p_1): Move most of malloc_candidate_p
> > into this function and add support for detecting multiple phis.
> > (DUMP_AND_RETURN): Move from malloc_candidate_p into top-level macro.
> >
> OK.
Hi Jeff,
Thanks for the review, and sorry for the delay.
Committed it as r264838 after re-bootstrap+test on x86_64 with
--enable-languages=all,ada,go.
Thanks,
Prathamesh
> jeff
>
>