This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [4.5] Autoinc support in tree-ssa-loop-ivopts.c


Zdenek Dvorak wrote:
thanks for looking into the issue.

	(iv_ca_recount_cost): Give a bonus to a candidate/use pair where the
	candidate is used exactly once in the loop in a way that allows
	autoincrement addressing.

This is a too costly way to implement this idea. iv_ca_recount_cost is called a lot, and the patch adds a quadratic loop (#of candidates * #of uses) to it, that furthermore invokes a rather costly computation. At the very least you should move the computation to the point where USE becomes the single use of CAND. Also, it should be possible to do most of the work of autoinc_possible_at in get_computation_cost_at (see the patch proposed for PR 31849 in bugzilla for inspiration), and to avoid the code duplication.

Another thing: is this really the right condition to detect? I would
expect autoinc modes to be useful even in cases where more than one
memory reference and possibly also the exit test are based on the
autoincremented induction variable.

Here's a new patch which has been extensively changed.


One possible condition to test for would be whether the uses closest to the position of the biv increment (either before or after) allow autoincrement. That seems to me rather expensive since we'd have to walk the basic blocks a few times to determine an order for the uses, so I've chosen something slightly weaker: either all uses before the increment, or all uses after the increment must allow autoincrement. This condition gives us a strict superset of opportunites compared to the one used by the previous patch.

The cost of the code in iv_ca_recount_cost is reduced by this since most of the tracking is now done in iv_ca_set{_no,}_cp.

I've added code to test for the availability of each of the four autoinc addressing modes for every machine mode.

Not too much testing yet other than comparing generated code for a lot of examples. If this looks OK to you, I'll start bootstrap etc.


Bernd -- This footer brought to you by insane German lawmakers. Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
	* tree-ssa-loop-ivopts.c (struct cost_pair): New members CAN_AUTOINC
	and USE_AFTER_INC.
	(struct iv_cand): New member COST_STEP.
	(struct iv_ca): New members N_CAND_USES_BEFORE_INC,
	N_CAND_USES_AFTER_INC, N_CAND_AUTOINC_USES_BEFORE_INC,
	N_CAND_AUTOINC_USES_AFTER_INC.
	(iv_ca_set_no_cp, iv_ca_set_cp): Keep track of them.
	(iv_ca_new): initialize them.
	(find_cost_pair): New static function.
	(set_use_iv_cost): Use it.  New argument CAN_AUTOINC, used to
	initialize the corresponding member in the cost_pair; all callers
	changed.
	(get_address_cost): New arguments STMT_AFTER_INC and MAY_AUTOINC.
	All callers changed.  Check for availability of autoinc addressing
	modes, both in general for a given mode, and in the specific use
	case.
	(get_computation_cost_at): New argument CAN_AUTOINC.  All callers
	changed.
	(get_computation_cost): Likewise.
	(determine_use_iv_cost): Initialize the USE_AFTER_INC member of the
	appropriate cost_pair.
	(determine_use_iv_costs): Dump the autoinc bonus.
	(determine_iv_cost): Record the cost of the increment in the COST_STEP
	member of the candidate.
	(iv_ca_recount_cost): Add a heuristic to decide if autoincrement is
	likely to be used for a candidate, and decrement the cost by its
	COST_STEP if so.
	(tree_ssa_iv_optimize_loop): Swap the calls to determine_iv_costs and
	determine_use_iv_costs.

Index: tree-ssa-loop-ivopts.c
===================================================================
--- tree-ssa-loop-ivopts.c	(revision 147092)
+++ tree-ssa-loop-ivopts.c	(working copy)
@@ -155,6 +155,10 @@ struct cost_pair
   tree value;		/* For final value elimination, the expression for
 			   the final value of the iv.  For iv elimination,
 			   the new bound to compare with.  */
+  bool can_autoinc;	/* True if we think we can use autoincrement for
+			   this candidate/use pair.  */
+  bool use_after_inc;   /* True if the statement of the use is before the
+			   increment of the candidate.  */
 };
 
 /* Use.  */
@@ -200,6 +204,7 @@ struct iv_cand
 			   to replace the final value of an iv by direct
 			   computation of the value.  */
   unsigned cost;	/* Cost of the candidate.  */
+  unsigned cost_step;	/* Cost of the candidate's increment insn.  */
   bitmap depends_on;	/* The list of invariants that are used in step of the
 			   biv.  */
 };
@@ -270,6 +275,14 @@ struct iv_ca
   /* Number of times each candidate is used.  */
   unsigned *n_cand_uses;
 
+  /* More detailed versions of n_cand_uses, counting the number of times it
+     is used before the increment, and how many uses can benefit from autoinc
+     addressing.  */
+  unsigned *n_cand_uses_before_inc;
+  unsigned *n_cand_uses_after_inc;
+  unsigned *n_cand_autoinc_uses_before_inc;
+  unsigned *n_cand_autoinc_uses_after_inc;
+
   /* The candidates used.  */
   bitmap cands;
 
@@ -2467,48 +2480,54 @@ infinite_cost_p (comp_cost cost)
   return cost.cost == INFTY;
 }
 
-/* Sets cost of (USE, CANDIDATE) pair to COST and record that it depends
-   on invariants DEPENDS_ON and that the value used in expressing it
-   is VALUE.*/
+/* Find the cost_pair structure to hold data about the pair of USE and
+   CAND.  */
 
-static void
-set_use_iv_cost (struct ivopts_data *data,
-		 struct iv_use *use, struct iv_cand *cand,
-		 comp_cost cost, bitmap depends_on, tree value)
+static struct cost_pair *
+find_cost_pair (struct ivopts_data *data,
+		struct iv_use *use, struct iv_cand *cand)
 {
   unsigned i, s;
 
-  if (infinite_cost_p (cost))
-    {
-      BITMAP_FREE (depends_on);
-      return;
-    }
-
   if (data->consider_all_candidates)
-    {
-      use->cost_map[cand->id].cand = cand;
-      use->cost_map[cand->id].cost = cost;
-      use->cost_map[cand->id].depends_on = depends_on;
-      use->cost_map[cand->id].value = value;
-      return;
-    }
+    return use->cost_map + cand->id;
 
   /* n_map_members is a power of two, so this computes modulo.  */
   s = cand->id & (use->n_map_members - 1);
   for (i = s; i < use->n_map_members; i++)
     if (!use->cost_map[i].cand)
-      goto found;
+      return use->cost_map + i;
   for (i = 0; i < s; i++)
     if (!use->cost_map[i].cand)
-      goto found;
+      return use->cost_map + i;
 
   gcc_unreachable ();
+}
 
-found:
-  use->cost_map[i].cand = cand;
-  use->cost_map[i].cost = cost;
-  use->cost_map[i].depends_on = depends_on;
-  use->cost_map[i].value = value;
+/* Sets cost of (USE, CANDIDATE) pair to COST and record that it depends
+   on invariants DEPENDS_ON and that the value used in expressing it
+   is VALUE.*/
+
+static void
+set_use_iv_cost (struct ivopts_data *data,
+		 struct iv_use *use, struct iv_cand *cand,
+		 comp_cost cost, bitmap depends_on, tree value,
+		 bool can_autoinc)
+{
+  struct cost_pair *cp;
+
+  if (infinite_cost_p (cost))
+    {
+      BITMAP_FREE (depends_on);
+      return;
+    }
+
+  cp = find_cost_pair (data, use, cand);
+  cp->cand = cand;
+  cp->cost = cost;
+  cp->depends_on = depends_on;
+  cp->value = value;
+  cp->can_autoinc = can_autoinc;
 }
 
 /* Gets cost of (USE, CANDIDATE) pair.  */
@@ -2993,21 +3012,30 @@ multiplier_allowed_in_address_p (HOST_WI
    variable is omitted.  Compute the cost for a memory reference that accesses
    a memory location of mode MEM_MODE.
 
+   MAY_AUTOINC is set to true if the autoincrement (increasing index by
+   size of MEM_MODE / RATIO) is available.  To make this determination, we
+   look at the size of the increment to be made, which is given in CSTEP.
+   CSTEP may be zero if the step is unknown.
+   STMT_AFTER_INC is true iff the statement we're looking at is after the
+   increment of the original biv.
+
    TODO -- there must be some better way.  This all is quite crude.  */
 
 static comp_cost
 get_address_cost (bool symbol_present, bool var_present,
 		  unsigned HOST_WIDE_INT offset, HOST_WIDE_INT ratio,
-		  enum machine_mode mem_mode,
-		  bool speed)
+		  HOST_WIDE_INT cstep, enum machine_mode mem_mode, bool speed,
+		  bool stmt_after_inc, bool *may_autoinc)
 {
   static bool initialized[MAX_MACHINE_MODE];
   static HOST_WIDE_INT rat[MAX_MACHINE_MODE], off[MAX_MACHINE_MODE];
   static HOST_WIDE_INT min_offset[MAX_MACHINE_MODE], max_offset[MAX_MACHINE_MODE];
   static unsigned costs[MAX_MACHINE_MODE][2][2][2][2];
+  static bool has_preinc[MAX_MACHINE_MODE], has_postinc[MAX_MACHINE_MODE];
+  static bool has_predec[MAX_MACHINE_MODE], has_postdec[MAX_MACHINE_MODE];
   unsigned cost, acost, complexity;
-  bool offset_p, ratio_p;
-  HOST_WIDE_INT s_offset;
+  bool offset_p, ratio_p, autoinc;
+  HOST_WIDE_INT s_offset, autoinc_offset, msize;
   unsigned HOST_WIDE_INT mask;
   unsigned bits;
 
@@ -3066,6 +3094,26 @@ get_address_cost (bool symbol_present, b
       reg0 = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 1);
       reg1 = gen_raw_REG (Pmode, LAST_VIRTUAL_REGISTER + 2);
 
+      if (HAVE_PRE_DECREMENT)
+	{
+	  addr = gen_rtx_PRE_DEC (Pmode, reg0);
+	  has_predec[mem_mode] = memory_address_p (mem_mode, addr);
+	}
+      if (HAVE_POST_DECREMENT)
+	{
+	  addr = gen_rtx_POST_DEC (Pmode, reg0);
+	  has_postdec[mem_mode] = memory_address_p (mem_mode, addr);
+	}
+      if (HAVE_PRE_INCREMENT)
+	{
+	  addr = gen_rtx_PRE_INC (Pmode, reg0);
+	  has_preinc[mem_mode] = memory_address_p (mem_mode, addr);
+	}
+      if (HAVE_POST_INCREMENT)
+	{
+	  addr = gen_rtx_POST_INC (Pmode, reg0);
+	  has_postinc[mem_mode] = memory_address_p (mem_mode, addr);
+	}
       for (i = 0; i < 16; i++)
 	{
 	  sym_p = i & 1;
@@ -3104,7 +3152,7 @@ get_address_cost (bool symbol_present, b
     
 	  if (base)
 	    addr = gen_rtx_fmt_ee (PLUS, Pmode, addr, base);
-  
+
 	  start_sequence ();
 	  /* To avoid splitting addressing modes, pretend that no cse will
 	     follow.  */
@@ -3149,7 +3197,7 @@ get_address_cost (bool symbol_present, b
 	  if (acost < costs[mem_mode][1][var_p][off_p][rat_p])
 	    costs[mem_mode][1][var_p][off_p][rat_p] = acost;
 	}
-  
+
       if (dump_file && (dump_flags & TDF_DETAILS))
 	{
 	  fprintf (dump_file, "Address costs:\n");
@@ -3174,6 +3222,9 @@ get_address_cost (bool symbol_present, b
 	      acost = costs[mem_mode][sym_p][var_p][off_p][rat_p];
 	      fprintf (dump_file, "index costs %d\n", acost);
 	    }
+	  if (has_predec[mem_mode] || has_postdec[mem_mode]
+	      || has_preinc[mem_mode] || has_postinc[mem_mode])
+	    fprintf (dump_file, "  May include autoinc/dec\n");
 	  fprintf (dump_file, "\n");
 	}
     }
@@ -3185,6 +3236,24 @@ get_address_cost (bool symbol_present, b
     offset |= ~mask;
   s_offset = offset;
 
+  autoinc = false;
+  msize = GET_MODE_SIZE (mem_mode);
+  autoinc_offset = offset;
+  if (stmt_after_inc)
+    autoinc_offset += cstep * ratio; 
+  if (s_offset || symbol_present || var_present || ratio != 1)
+    autoinc = false;
+  else if (0
+	   || (has_postinc[mem_mode] && autoinc_offset == 0
+	       && msize == cstep)
+	   || (has_postdec[mem_mode] && autoinc_offset == 0
+	       && msize == -cstep)
+	   || (has_preinc[mem_mode] && autoinc_offset == msize
+	       && msize == cstep)
+	   || (has_predec[mem_mode] && autoinc_offset == -msize
+	       && msize == -cstep))
+    autoinc = true;
+
   cost = 0;
   offset_p = (s_offset != 0
 	      && min_offset[mem_mode] <= s_offset
@@ -3198,6 +3267,8 @@ get_address_cost (bool symbol_present, b
   if (s_offset && !offset_p && !symbol_present)
     cost += add_cost (Pmode, speed);
 
+  if (may_autoinc)
+    *may_autoinc = autoinc;
   acost = costs[mem_mode][symbol_present][var_present][offset_p][ratio_p];
   complexity = (symbol_present != 0) + (var_present != 0) + offset_p + ratio_p;
   return new_cost (cost + acost, complexity);
@@ -3502,14 +3573,15 @@ difference_cost (struct ivopts_data *dat
 static comp_cost
 get_computation_cost_at (struct ivopts_data *data,
 			 struct iv_use *use, struct iv_cand *cand,
-			 bool address_p, bitmap *depends_on, gimple at)
+			 bool address_p, bitmap *depends_on, gimple at,
+			 bool *can_autoinc)
 {
   tree ubase = use->iv->base, ustep = use->iv->step;
   tree cbase, cstep;
   tree utype = TREE_TYPE (ubase), ctype;
   unsigned HOST_WIDE_INT cstepi, offset = 0;
   HOST_WIDE_INT ratio, aratio;
-  bool var_present, symbol_present;
+  bool var_present, symbol_present, stmt_is_after_inc;
   comp_cost cost;
   unsigned n_sums;
   double_int rat;
@@ -3604,16 +3676,20 @@ get_computation_cost_at (struct ivopts_d
 
   /* If we are after the increment, the value of the candidate is higher by
      one iteration.  */
-  if (stmt_after_increment (data->current_loop, cand, at))
+  stmt_is_after_inc = stmt_after_increment (data->current_loop, cand, at);
+  if (stmt_is_after_inc)
     offset -= ratio * cstepi;
 
   /* Now the computation is in shape symbol + var1 + const + ratio * var2.
      (symbol/var/const parts may be omitted).  If we are looking for an address,
      find the cost of addressing this.  */
   if (address_p)
-    return add_costs (cost, get_address_cost (symbol_present, var_present,
-				offset, ratio,
-				TYPE_MODE (TREE_TYPE (*use->op_p)), speed));
+    return add_costs (cost,
+		      get_address_cost (symbol_present, var_present,
+					offset, ratio, cstepi,
+					TYPE_MODE (TREE_TYPE (*use->op_p)),
+					speed, stmt_is_after_inc,
+					can_autoinc));
 
   /* Otherwise estimate the costs for computing the expression.  */
   aratio = ratio > 0 ? ratio : -ratio;
@@ -3666,10 +3742,11 @@ fallback:
 static comp_cost
 get_computation_cost (struct ivopts_data *data,
 		      struct iv_use *use, struct iv_cand *cand,
-		      bool address_p, bitmap *depends_on)
+		      bool address_p, bitmap *depends_on, bool *can_autoinc)
 {
   return get_computation_cost_at (data,
-				  use, cand, address_p, depends_on, use->stmt);
+				  use, cand, address_p, depends_on, use->stmt,
+				  can_autoinc);
 }
 
 /* Determines cost of basing replacement of USE on CAND in a generic
@@ -3689,12 +3766,12 @@ determine_use_iv_cost_generic (struct iv
   if (cand->pos == IP_ORIGINAL
       && cand->incremented_at == use->stmt)
     {
-      set_use_iv_cost (data, use, cand, zero_cost, NULL, NULL_TREE);
+      set_use_iv_cost (data, use, cand, zero_cost, NULL, NULL_TREE, false);
       return true;
     }
 
-  cost = get_computation_cost (data, use, cand, false, &depends_on);
-  set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE);
+  cost = get_computation_cost (data, use, cand, false, &depends_on, NULL);
+  set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE, false);
 
   return !infinite_cost_p (cost);
 }
@@ -3706,9 +3783,11 @@ determine_use_iv_cost_address (struct iv
 			       struct iv_use *use, struct iv_cand *cand)
 {
   bitmap depends_on;
-  comp_cost cost = get_computation_cost (data, use, cand, true, &depends_on);
+  bool can_autoinc;
+  comp_cost cost = get_computation_cost (data, use, cand, true, &depends_on,
+					 &can_autoinc);
 
-  set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE);
+  set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE, can_autoinc);
 
   return !infinite_cost_p (cost);
 }
@@ -3866,7 +3945,7 @@ determine_use_iv_cost_condition (struct 
   /* Only consider real candidates.  */
   if (!cand->iv)
     {
-      set_use_iv_cost (data, use, cand, infinite_cost, NULL, NULL_TREE);
+      set_use_iv_cost (data, use, cand, infinite_cost, NULL, NULL_TREE, false);
       return false;
     }
 
@@ -3887,7 +3966,7 @@ determine_use_iv_cost_condition (struct 
   gcc_assert (ok);
 
   express_cost = get_computation_cost (data, use, cand, false,
-				       &depends_on_express);
+				       &depends_on_express, NULL);
   fd_ivopts_data = data;
   walk_tree (&cmp_iv->base, find_depends, &depends_on_express, NULL);
 
@@ -3906,7 +3985,7 @@ determine_use_iv_cost_condition (struct 
       bound = NULL_TREE;
     }
 
-  set_use_iv_cost (data, use, cand, cost, depends_on, bound);
+  set_use_iv_cost (data, use, cand, cost, depends_on, bound, false);
 
   if (depends_on_elim)
     BITMAP_FREE (depends_on_elim);
@@ -3923,6 +4002,11 @@ static bool
 determine_use_iv_cost (struct ivopts_data *data,
 		       struct iv_use *use, struct iv_cand *cand)
 {
+  /* Precompute use_after_inc here for every cost pair, so that we can
+     cheaply use it later.  */
+  struct cost_pair *cp = find_cost_pair (data, use, cand);
+  cp->use_after_inc = stmt_after_increment (data->current_loop, cand,
+					    use->stmt);
   switch (use->type)
     {
     case USE_NONLINEAR_EXPR:
@@ -3992,16 +4076,18 @@ determine_use_iv_costs (struct ivopts_da
 	  use = iv_use (data, i);
 
 	  fprintf (dump_file, "Use %d:\n", i);
-	  fprintf (dump_file, "  cand\tcost\tcompl.\tdepends on\n");
+	  fprintf (dump_file, "  cand\tcost\tainc b.\tcompl.\tdepends on\n");
 	  for (j = 0; j < use->n_map_members; j++)
 	    {
 	      if (!use->cost_map[j].cand
 		  || infinite_cost_p (use->cost_map[j].cost))
 		continue;
 
-	      fprintf (dump_file, "  %d\t%d\t%d\t",
+	      fprintf (dump_file, "  %d\t%d\t%d\t%d\t",
 		       use->cost_map[j].cand->id,
 		       use->cost_map[j].cost.cost,
+		       (use->cost_map[j].can_autoinc
+			? use->cost_map[j].cand->cost_step : 0),
 		       use->cost_map[j].cost.complexity);
 	      if (use->cost_map[j].depends_on)
 		bitmap_print (dump_file,
@@ -4054,6 +4140,7 @@ determine_iv_cost (struct ivopts_data *d
     cost++;
 
   cand->cost = cost;
+  cand->cost_step = cost_step;
 }
 
 /* Determines costs of computation of the candidates.  */
@@ -4204,9 +4291,27 @@ static void
 iv_ca_recount_cost (struct ivopts_data *data, struct iv_ca *ivs)
 {
   comp_cost cost = ivs->cand_use_cost;
+  unsigned i;
+
   cost.cost += ivs->cand_cost;
   cost.cost += ivopts_global_cost_for_size (data, ivs->n_regs);
 
+  /* Try to give a bonus to single uses of a candidate in an address,
+     where we think this might lead to autoinc addressing later on.  */
+  for (i = 0; i < n_iv_cands (data); i++)
+    {
+      struct iv_cand *cand = iv_cand (data, i);
+      if ((ivs->n_cand_uses_before_inc[i] > 0
+	   && (ivs->n_cand_autoinc_uses_before_inc[i]
+	       == ivs->n_cand_uses_before_inc[i]))
+	  || (ivs->n_cand_uses_after_inc[i] > 0
+	      && (ivs->n_cand_autoinc_uses_after_inc[i]
+		  == ivs->n_cand_uses_after_inc[i])))
+	{
+	  cost.cost -= cand->cost_step;
+	}
+    }
+
   ivs->cost = cost;
 }
 
@@ -4247,6 +4352,19 @@ iv_ca_set_no_cp (struct ivopts_data *dat
   ivs->cand_for_use[uid] = NULL;
   ivs->n_cand_uses[cid]--;
 
+  if (cp->use_after_inc)
+    {
+      ivs->n_cand_uses_after_inc[cid]--;
+      if (cp->can_autoinc)
+	ivs->n_cand_autoinc_uses_after_inc[cid]--;
+    }
+  else
+    {
+      ivs->n_cand_uses_before_inc[cid]--;
+      if (cp->can_autoinc)
+	ivs->n_cand_autoinc_uses_before_inc[cid]--;
+    }
+
   if (ivs->n_cand_uses[cid] == 0)
     {
       bitmap_clear_bit (ivs->cands, cid);
@@ -4305,6 +4423,20 @@ iv_ca_set_cp (struct ivopts_data *data, 
       ivs->bad_uses--;
       ivs->cand_for_use[uid] = cp;
       ivs->n_cand_uses[cid]++;
+      
+      if (cp->use_after_inc)
+	{
+	  ivs->n_cand_uses_after_inc[cid]++;
+	  if (cp->can_autoinc)
+	    ivs->n_cand_autoinc_uses_after_inc[cid]++;
+	}
+      else
+	{
+	  ivs->n_cand_uses_before_inc[cid]++;
+	  if (cp->can_autoinc)
+	    ivs->n_cand_autoinc_uses_before_inc[cid]++;
+	}
+
       if (ivs->n_cand_uses[cid] == 1)
 	{
 	  bitmap_set_bit (ivs->cands, cid);
@@ -4316,7 +4448,7 @@ iv_ca_set_cp (struct ivopts_data *data, 
 
 	  iv_ca_set_add_invariants (ivs, cp->cand->depends_on);
 	}
-
+  
       ivs->cand_use_cost = add_costs (ivs->cand_use_cost, cp->cost);
       iv_ca_set_add_invariants (ivs, cp->depends_on);
       iv_ca_recount_cost (data, ivs);
@@ -4522,6 +4654,10 @@ iv_ca_new (struct ivopts_data *data)
   nw->bad_uses = 0;
   nw->cand_for_use = XCNEWVEC (struct cost_pair *, n_iv_uses (data));
   nw->n_cand_uses = XCNEWVEC (unsigned, n_iv_cands (data));
+  nw->n_cand_uses_before_inc = XCNEWVEC (unsigned, n_iv_cands (data));
+  nw->n_cand_uses_after_inc = XCNEWVEC (unsigned, n_iv_cands (data));
+  nw->n_cand_autoinc_uses_before_inc = XCNEWVEC (unsigned, n_iv_cands (data));
+  nw->n_cand_autoinc_uses_after_inc = XCNEWVEC (unsigned, n_iv_cands (data));
   nw->cands = BITMAP_ALLOC (NULL);
   nw->n_cands = 0;
   nw->n_regs = 0;
@@ -5497,9 +5685,9 @@ tree_ssa_iv_optimize_loop (struct ivopts
   /* Finds candidates for the induction variables (item 2).  */
   find_iv_candidates (data);
 
   /* Calculates the costs (item 3, part 1).  */
-  determine_use_iv_costs (data);
   determine_iv_costs (data);
+  determine_use_iv_costs (data);
   determine_set_costs (data);
 
   /* Find the optimal set of induction variables (item 3, part 2).  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]