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.kulka...@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.
jeff