https://gcc.gnu.org/g:d0108442f479572663da20b73b93c31a205ab181

commit d0108442f479572663da20b73b93c31a205ab181
Author: Andrew Pinski <quic_apin...@quicinc.com>
Date:   Sun Jul 6 11:40:44 2025 -0700

    ifconv: Remove unused array predicated
    
    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.
    
    gcc/ChangeLog:
    
            * tree-if-conv.cc (combine_blocks): Remove predicated
            dynamic array.
    
    Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>

Diff:
---
 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 636361e7c360..d2b9f9fe0809 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

Reply via email to