aboutsummaryrefslogtreecommitdiff
path: root/gcc/matrix-reorg.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2007-07-10 01:04:06 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2007-07-09 23:04:06 +0000
commitc6540bdeb4a50fadc96f5b0087cca5602ad04845 (patch)
treee5a7ffd19651ec8e341a482d405d293a6e720838 /gcc/matrix-reorg.c
parent452ba14de17872cf0d51da73f6faa6b2f3668753 (diff)
downloadgcc-c6540bdeb4a50fadc96f5b0087cca5602ad04845.zip
gcc-c6540bdeb4a50fadc96f5b0087cca5602ad04845.tar.gz
gcc-c6540bdeb4a50fadc96f5b0087cca5602ad04845.tar.bz2
tree-scalar-evolution.c (scev_const_prop): Add arguments to force_gimple_operand_bsi.
* tree-scalar-evolution.c (scev_const_prop): Add arguments to force_gimple_operand_bsi. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr, rewrite_use_compare): Ditto. * tree-ssa-address.c (gimplify_mem_ref_parts, create_mem_ref): Ditto. * tree-ssa-ifcombine.c (ifcombine_ifandif): Ditto. * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Ditto. * lambda-code.c (replace_uses_equiv_to_x_with_y): Ditto. * tree-profile.c (prepare_instrumented_value, tree_gen_interval_profiler, tree_gen_pow2_profiler, tree_gen_one_value_profiler, tree_gen_ic_profiler, tree_gen_ic_func_profiler, tree_gen_average_profiler, tree_gen_ior_profiler): Ditto. * tree-ssa-reassoc.c (negate_value): Ditto. * matrix-reorg.c (transform_access_sites, transform_allocation_sites): Use force_gimple_operand_bsi. * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Ditto. * tree-if-conv.c (add_to_dst_predicate_list, find_phi_replacement_condition): Ditto. * gimplify.c (force_gimple_operand_bsi): Add before and m arguments. Call mark_symbols_for_renaming for new statements. * tree-flow.h (force_gimple_operand_bsi): Declaration changed. From-SVN: r126500
Diffstat (limited to 'gcc/matrix-reorg.c')
-rw-r--r--gcc/matrix-reorg.c61
1 files changed, 13 insertions, 48 deletions
diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c
index 1890734..5b54fe0 100644
--- a/gcc/matrix-reorg.c
+++ b/gcc/matrix-reorg.c
@@ -1708,7 +1708,6 @@ compute_offset (HOST_WIDE_INT orig, HOST_WIDE_INT new, tree result)
static int
transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{
- tree stmts;
block_stmt_iterator bsi;
struct matrix_info *mi = *slot;
int min_escape_l = mi->min_indirect_level_escape;
@@ -1831,19 +1830,10 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
total_elements = new_offset;
if (new_offset != offset)
{
- tmp1 =
- force_gimple_operand (total_elements, &stmts, true,
- NULL);
- if (stmts)
- {
- tree_stmt_iterator tsi;
-
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi);
- tsi_next (&tsi))
- mark_symbols_for_renaming (tsi_stmt (tsi));
- bsi = bsi_for_stmt (acc_info->stmt);
- bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
- }
+ bsi = bsi_for_stmt (acc_info->stmt);
+ tmp1 = force_gimple_operand_bsi (&bsi, total_elements,
+ true, NULL,
+ true, BSI_SAME_STMT);
}
else
tmp1 = offset;
@@ -1855,18 +1845,10 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
num_elements =
fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, acc_info->index),
fold_convert (sizetype, d_size));
- tmp1 = force_gimple_operand (num_elements, &stmts, true, NULL);
add_referenced_var (d_size);
- if (stmts)
- {
- tree_stmt_iterator tsi;
-
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi);
- tsi_next (&tsi))
- mark_symbols_for_renaming (tsi_stmt (tsi));
- bsi = bsi_for_stmt (acc_info->stmt);
- bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
- }
+ bsi = bsi_for_stmt (acc_info->stmt);
+ tmp1 = force_gimple_operand_bsi (&bsi, num_elements, true,
+ NULL, true, BSI_SAME_STMT);
}
/* Replace the offset if needed. */
if (tmp1 != offset)
@@ -1942,7 +1924,7 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{
int i;
struct matrix_info *mi;
- tree type, call_stmt_0, malloc_stmt, oldfn, stmts, prev_dim_size, use_stmt;
+ tree type, call_stmt_0, malloc_stmt, oldfn, prev_dim_size, use_stmt;
struct cgraph_node *c_node;
struct cgraph_edge *e;
block_stmt_iterator bsi;
@@ -2069,7 +2051,6 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{
tree dim_size, dim_var, tmp;
tree d_type_size;
- tree_stmt_iterator tsi;
/* Now put the size expression in a global variable and initialize it to
the size expression before the malloc of level 0. */
@@ -2099,20 +2080,13 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
dim_size = fold_build2 (MULT_EXPR, type, dim_size, prev_dim_size);
}
- dim_size = force_gimple_operand (dim_size, &stmts, true, NULL);
- if (stmts)
- {
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
- mark_symbols_for_renaming (tsi_stmt (tsi));
- bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
- bsi = bsi_for_stmt (call_stmt_0);
- }
+ dim_size = force_gimple_operand_bsi (&bsi, dim_size, true, NULL,
+ true, BSI_SAME_STMT);
/* GLOBAL_HOLDING_THE_SIZE = DIM_SIZE. */
tmp = fold_build2 (GIMPLE_MODIFY_STMT, type, dim_var, dim_size);
GIMPLE_STMT_OPERAND (tmp, 0) = dim_var;
mark_symbols_for_renaming (tmp);
- bsi_insert_before (&bsi, tmp, BSI_NEW_STMT);
- bsi = bsi_for_stmt (call_stmt_0);
+ bsi_insert_before (&bsi, tmp, BSI_SAME_STMT);
prev_dim_size = mi->dimension_size[i] = dim_var;
}
@@ -2122,17 +2096,8 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
malloc_stmt = GIMPLE_STMT_OPERAND (call_stmt_0, 1);
c_node = cgraph_node (mi->allocation_function_decl);
old_size_0 = CALL_EXPR_ARG (malloc_stmt, 0);
- bsi = bsi_for_stmt (call_stmt_0);
- tmp = force_gimple_operand (mi->dimension_size[0], &stmts, true, NULL);
- if (stmts)
- {
- tree_stmt_iterator tsi;
-
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
- mark_symbols_for_renaming (tsi_stmt (tsi));
- bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
- bsi = bsi_for_stmt (call_stmt_0);
- }
+ tmp = force_gimple_operand_bsi (&bsi, mi->dimension_size[0], true,
+ NULL, true, BSI_SAME_STMT);
if (TREE_CODE (old_size_0) == SSA_NAME)
{
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, old_size_0)