summaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-strength-reduction.c
diff options
context:
space:
mode:
authorwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-26 13:10:04 +0000
committerwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>2012-07-26 13:10:04 +0000
commit726556769945a83a856e39bdcb44a090cd5547bb (patch)
treed1c32e077e8672a0302c870fe8ff5a2256a82879 /gcc/gimple-ssa-strength-reduction.c
parent4f862fce4a1472026631923d26ef754f21c67c73 (diff)
downloadgcc-726556769945a83a856e39bdcb44a090cd5547bb.tar.gz
2012-07-26 Bill Schmidt <wschmidt@linux.ibm.com>
* tree-ssa-loop-ivopts.c (mbc_entry_hash): Remove. (mbc_entry_eq): Likewise. (mult_costs): Likewise. (cost_tables_exist): Likewise. (initialize_costs): Likewise. (finalize_costs): Likewise. (tree_ssa_iv_optimize_init): Remove call to initialize_costs. (add_regs_cost): Remove. (multiply_regs_cost): Likewise. (add_const_cost): Likewise. (extend_or_trunc_reg_cost): Likewise. (negate_reg_cost): Likewise. (struct mbc_entry): Likewise. (multiply_by_const_cost): Likewise. (get_address_cost): Change add_regs_cost calls to add_cost lookups; change multiply_by_const_cost to mult_by_coeff_cost. (force_expr_to_var_cost): Likewise. (difference_cost): Change multiply_by_const_cost to mult_by_coeff_cost. (get_computation_cost_at): Change add_regs_cost calls to add_cost lookups; change multiply_by_const_cost to mult_by_coeff_cost. (determine_iv_cost): Change add_regs_cost calls to add_cost lookups. (tree_ssa_iv_optimize_finalize): Remove call to finalize_costs. * tree-ssa-address.c (expmed.h): New #include. (most_expensive_mult_to_index): Change multiply_by_const_cost to mult_by_coeff_cost. * gimple-ssa-strength-reduction.c (expmed.h): New #include. (stmt_cost): Change to use mult_by_coeff_cost, mul_cost, add_cost, neg_cost, and convert_cost instead of IVOPTS interfaces. (execute_strength_reduction): Remove calls to initialize_costs and finalize_costs. * expmed.c (struct init_expmed_rtl): Add convert rtx_def. (init_expmed_one_mode): Initialize convert rtx_def; initialize x_convert_cost for related modes. (mult_by_coeff_cost): New function. * expmed.h (NUM_MODE_INT): New #define. (struct target_expmed): Add x_convert_cost matrix. (set_convert_cost): New inline function. (convert_cost): Likewise. (mult_by_coeff_cost): New extern decl. * tree-flow.h (initialize_costs): Remove decl. (finalize_costs): Likewise. (multiply_by_const_cost): Likewise. (add_regs_cost): Likewise. (multiply_regs_cost): Likewise. (add_const_cost): Likewise. (extend_or_trunc_reg_cost): Likewise. (negate_reg_cost): Likewise. * Makefile.in (gimple-ssa-strength-reduction.o): Update dependencies. (tree-ssa-address.o): Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-ssa-strength-reduction.c')
-rw-r--r--gcc/gimple-ssa-strength-reduction.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index c7ec1e9b0a8..afeb70fdeb0 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-flow.h"
#include "domwalk.h"
#include "pointer-set.h"
+#include "expmed.h"
/* Information about a strength reduction candidate. Each statement
in the candidate table represents an expression of one of the
@@ -340,29 +341,22 @@ stmt_cost (gimple gs, bool speed)
rhs2 = gimple_assign_rhs2 (gs);
if (host_integerp (rhs2, 0))
- return multiply_by_const_cost (TREE_INT_CST_LOW (rhs2), lhs_mode,
- speed);
+ return mult_by_coeff_cost (TREE_INT_CST_LOW (rhs2), lhs_mode, speed);
gcc_assert (TREE_CODE (rhs1) != INTEGER_CST);
- return multiply_regs_cost (TYPE_MODE (TREE_TYPE (lhs)), speed);
+ return mul_cost[speed][lhs_mode];
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
case MINUS_EXPR:
rhs2 = gimple_assign_rhs2 (gs);
-
- if (host_integerp (rhs2, 0))
- return add_const_cost (TYPE_MODE (TREE_TYPE (rhs1)), speed);
-
- gcc_assert (TREE_CODE (rhs1) != INTEGER_CST);
- return add_regs_cost (lhs_mode, speed);
+ return add_cost[speed][lhs_mode];
case NEGATE_EXPR:
- return negate_reg_cost (lhs_mode, speed);
+ return neg_cost[speed][lhs_mode];
case NOP_EXPR:
- return extend_or_trunc_reg_cost (TREE_TYPE (lhs), TREE_TYPE (rhs1),
- speed);
+ return convert_cost (lhs_mode, TYPE_MODE (TREE_TYPE (rhs1)), speed);
/* Note that we don't assign costs to copies that in most cases
will go away. */
@@ -1460,9 +1454,6 @@ execute_strength_reduction (void)
back edges, and this gives us dominator information as well. */
loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
- /* Initialize costs tables in IVOPTS. */
- initialize_costs ();
-
/* Set up callbacks for the generic dominator tree walker. */
walk_data.dom_direction = CDI_DOMINATORS;
walk_data.initialize_block_local_data = NULL;
@@ -1493,7 +1484,6 @@ execute_strength_reduction (void)
pointer_map_destroy (stmt_cand_map);
VEC_free (slsr_cand_t, heap, cand_vec);
obstack_free (&cand_obstack, NULL);
- finalize_costs ();
return 0;
}