nir/loop_analyze: Eliminate nir_basic_induction_var
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 7 Feb 2023 21:11:51 +0000 (13:11 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Feb 2023 22:12:05 +0000 (22:12 +0000)
No longer used. All of the information that was previously track here is
tracked directly in nir_loop_variable... and, technically speaking, has
been tracked there ever since 0b9639c35d0a.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>

src/compiler/nir/nir_loop_analyze.c

index 9064030..f2cd13c 100644 (file)
@@ -33,11 +33,6 @@ typedef enum {
    basic_induction
 } nir_loop_variable_type;
 
-typedef struct nir_basic_induction_var {
-   nir_alu_instr *alu;                      /* The def of the alu-operation */
-   nir_ssa_def *def_outside_loop;           /* The phi-src outside the loop */
-} nir_basic_induction_var;
-
 typedef struct {
    /* A link for the work list */
    struct list_head process_link;
@@ -50,9 +45,6 @@ typedef struct {
    /* The type of this ssa_def */
    nir_loop_variable_type type;
 
-   /* If this is of type basic_induction */
-   struct nir_basic_induction_var *ind;
-
    /* True if variable is in an if branch */
    bool in_if_branch;
 
@@ -421,7 +413,6 @@ compute_induction_information(loop_info_state *state)
          continue;
 
       nir_phi_instr *phi = nir_instr_as_phi(var->def->parent_instr);
-      nir_basic_induction_var *biv = rzalloc(state, nir_basic_induction_var);
 
       nir_loop_variable *alu_src_var = NULL;
       nir_foreach_phi_src(src, phi) {
@@ -485,9 +476,7 @@ compute_induction_information(loop_info_state *state)
             alu_src_var->init_src = var->init_src;
             alu_src_var->update_src = var->update_src;
             alu_src_var->type = basic_induction;
-            alu_src_var->ind = biv;
             var->type = basic_induction;
-            var->ind = biv;
 
             found_induction_var = true;
             num_induction_vars += 2;
@@ -497,16 +486,13 @@ compute_induction_information(loop_info_state *state)
             alu_src_var->update_src = var->update_src;
 
             num_induction_vars += 2;
-            ralloc_free(biv);
          } else {
             var->init_src = NULL;
             var->update_src = NULL;
-            ralloc_free(biv);
          }
       } else {
          var->init_src = NULL;
          var->update_src = NULL;
-         ralloc_free(biv);
       }
    }