tree-ssa-loop-ivopts.c (split_address_cost): Check depends_on.
authorBin Cheng <bin.cheng@arm.com>
Thu, 29 Oct 2015 04:40:37 +0000 (04:40 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Thu, 29 Oct 2015 04:40:37 +0000 (04:40 +0000)
* tree-ssa-loop-ivopts.c (split_address_cost): Check depends_on.
(get_computation_cost_at): Ditto.
(determine_use_iv_cost_address): Pass NULL for arguments depends_on
and inv_expr_id.

From-SVN: r229514

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index 36489c595c83a2df78572f6f3cfa12fd732bb981..39de254d7575ff2bfe09aa5fc586644c2792fdf2 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-29  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-ssa-loop-ivopts.c (split_address_cost): Check depends_on.
+       (get_computation_cost_at): Ditto.
+       (determine_use_iv_cost_address): Pass NULL for arguments depends_on
+       and inv_expr_id.
+
 2015-10-28  Tom de Vries  <tom@codesourcery.com>
 
        * tree-ssa-structalias.c (intra_create_variable_infos): Remove
index 945d34b4fa84d64424fcb95bc9324bdf271e5698..91f7284f91a35a6ee7b819e23dad2e7af9778d50 100644 (file)
@@ -4328,7 +4328,9 @@ split_address_cost (struct ivopts_data *data,
       *symbol_present = false;
       *var_present = true;
       fd_ivopts_data = data;
-      walk_tree (&addr, find_depends, depends_on, NULL);
+      if (depends_on)
+       walk_tree (&addr, find_depends, depends_on, NULL);
+
       return new_cost (target_spill_cost[data->speed], 0);
     }
 
@@ -4616,7 +4618,8 @@ get_computation_cost_at (struct ivopts_data *data,
                                ? TYPE_MODE (TREE_TYPE (*use->op_p))
                                : VOIDmode);
 
-  *depends_on = NULL;
+  if (depends_on)
+    *depends_on = NULL;
 
   /* Only consider real candidates.  */
   if (!cand->iv)
@@ -4908,9 +4911,9 @@ determine_use_iv_cost_address (struct ivopts_data *data,
        sub_use && !infinite_cost_p (cost);
        sub_use = sub_use->next)
     {
-       sub_cost = get_computation_cost (data, sub_use, cand, true, &depends_on,
-                                       &can_autoinc, &inv_expr_id);
-       cost = add_costs (cost, sub_cost);
+      sub_cost = get_computation_cost (data, sub_use, cand, true, NULL,
+                                      &can_autoinc, NULL);
+      cost = add_costs (cost, sub_cost);
     }
 
   set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE, ERROR_MARK,