On Mon, Jul 14, 2025 at 11:01 PM Andrew Pinski <quic_apin...@quicinc.com> wrote:
>
> While starting to improve if-conv, I noticed that predicated
> was only being set once inside a loop and accessed right below.
> This became this way due to r14-8869-g8636c538b68068 and before
> it was needed since it was accessed via 2 loops but now it is only set
> and then accessed in the next statement, there is no reason for it being
> there.  So let's remove it and just use the value from it instead.
>
> Bootstrapped and tested on x86_64-linux-gnu.

OK

> gcc/ChangeLog:
>
>         * tree-if-conv.cc (combine_blocks): Remove predicated
>         dynamic array.
>
> Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
> ---
>  gcc/tree-if-conv.cc | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
> index 636361e7c36..d2b9f9fe080 100644
> --- a/gcc/tree-if-conv.cc
> +++ b/gcc/tree-if-conv.cc
> @@ -3004,12 +3004,10 @@ combine_blocks (class loop *loop, bool loop_versioned)
>
>    /* Reset flow-sensitive info before predicating stmts or PHIs we
>       might fold.  */
> -  bool *predicated = XNEWVEC (bool, orig_loop_num_nodes);
>    for (i = 0; i < orig_loop_num_nodes; i++)
>      {
>        bb = ifc_bbs[i];
> -      predicated[i] = is_predicated (bb);
> -      if (predicated[i])
> +      if (is_predicated (bb))
>         {
>           for (auto gsi = gsi_start_phis (bb);
>                !gsi_end_p (gsi); gsi_next (&gsi))
> @@ -3211,7 +3209,6 @@ combine_blocks (class loop *loop, bool loop_versioned)
>
>    free (ifc_bbs);
>    ifc_bbs = NULL;
> -  free (predicated);
>  }
>
>  /* Version LOOP before if-converting it; the original loop
> --
> 2.43.0
>

Reply via email to