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: 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: Wed, 5 Sep 2018 15:32:54 +0530
- Subject: Re: PR85787: Extend malloc_candidate_p to handle multiple phis.
- References: <CAAgBjMmdps8GYfKX9-6BTSBZ_7ci++xJZ8sfB1=DNyqzEUwX+g@mail.gmail.com>
On 28 August 2018 at 16:56, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> 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 ?
ping https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01757.html
Thanks,
Prathamesh
>
> Thanks,
> Prathamesh