This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Add direction and bsi change arguments to force_gimple_operand_bsi
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dnovillo at google dot com
- Date: Tue, 19 Jun 2007 15:53:55 +0200
- Subject: [patch] Add direction and bsi change arguments to force_gimple_operand_bsi
Hello,
this patch adds two arguments to force_gimple_operand_bsi, that specify
whether the new code will be inserted before or after the prescribed
bsi, and how bsi is changed. It also makes force_gimple_operand_bsi
to scan the code for new symbols, and mark them for renaming.
The first change is not useful anywhere now, while the second one
simplifies the code in matrix-reorg.c. However, both are used
in the omp expanders on parloop branch (so I would like to have them
merged so that I proceed with the rest of the branch).
Bootstrapped & regtested on i686.
Zdenek
* 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.
Index: tree-scalar-evolution.c
===================================================================
*** tree-scalar-evolution.c (revision 125822)
--- tree-scalar-evolution.c (working copy)
*************** scev_const_prop (void)
*** 2851,2857 ****
{
block_stmt_iterator dest = bsi;
bsi_insert_before (&dest, ass, BSI_NEW_STMT);
! def = force_gimple_operand_bsi (&dest, def, false, NULL_TREE);
}
GIMPLE_STMT_OPERAND (ass, 1) = def;
update_stmt (ass);
--- 2851,2858 ----
{
block_stmt_iterator dest = bsi;
bsi_insert_before (&dest, ass, BSI_NEW_STMT);
! def = force_gimple_operand_bsi (&dest, def, false, NULL_TREE,
! true, BSI_SAME_STMT);
}
GIMPLE_STMT_OPERAND (ass, 1) = def;
update_stmt (ass);
Index: tree-ssa-loop-ivopts.c
===================================================================
*** tree-ssa-loop-ivopts.c (revision 125822)
--- tree-ssa-loop-ivopts.c (working copy)
*************** rewrite_use_nonlinear_expr (struct ivopt
*** 4861,4867 ****
struct iv_use *use, struct iv_cand *cand)
{
tree comp;
! tree op, stmts, tgt, ass;
block_stmt_iterator bsi;
/* An important special case -- if we are asked to express value of
--- 4861,4867 ----
struct iv_use *use, struct iv_cand *cand)
{
tree comp;
! tree op, tgt, ass;
block_stmt_iterator bsi;
/* An important special case -- if we are asked to express value of
*************** rewrite_use_nonlinear_expr (struct ivopt
*** 4945,4953 ****
gcc_unreachable ();
}
! op = force_gimple_operand (comp, &stmts, false, SSA_NAME_VAR (tgt));
! if (stmts)
! bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
if (TREE_CODE (use->stmt) == PHI_NODE)
{
--- 4945,4952 ----
gcc_unreachable ();
}
! op = force_gimple_operand_bsi (&bsi, comp, false, SSA_NAME_VAR (tgt),
! true, BSI_SAME_STMT);
if (TREE_CODE (use->stmt) == PHI_NODE)
{
*************** rewrite_use_compare (struct ivopts_data
*** 5113,5119 ****
compare = iv_elimination_compare (data, use);
bound = unshare_expr (fold_convert (var_type, bound));
! op = force_gimple_operand_bsi (&bsi, bound, true, NULL_TREE);
*use->op_p = build2 (compare, boolean_type_node, var, op);
return;
--- 5112,5119 ----
compare = iv_elimination_compare (data, use);
bound = unshare_expr (fold_convert (var_type, bound));
! op = force_gimple_operand_bsi (&bsi, bound, true, NULL_TREE,
! true, BSI_SAME_STMT);
*use->op_p = build2 (compare, boolean_type_node, var, op);
return;
*************** rewrite_use_compare (struct ivopts_data
*** 5127,5133 ****
ok = extract_cond_operands (data, use->op_p, &var_p, NULL, NULL, NULL);
gcc_assert (ok);
! *var_p = force_gimple_operand_bsi (&bsi, comp, true, SSA_NAME_VAR (*var_p));
}
/* Rewrites USE using candidate CAND. */
--- 5127,5134 ----
ok = extract_cond_operands (data, use->op_p, &var_p, NULL, NULL, NULL);
gcc_assert (ok);
! *var_p = force_gimple_operand_bsi (&bsi, comp, true, SSA_NAME_VAR (*var_p),
! true, BSI_SAME_STMT);
}
/* Rewrites USE using candidate CAND. */
Index: tree-ssa-address.c
===================================================================
*** tree-ssa-address.c (revision 125822)
--- tree-ssa-address.c (working copy)
*************** gimplify_mem_ref_parts (block_stmt_itera
*** 556,565 ****
{
if (parts->base)
parts->base = force_gimple_operand_bsi (bsi, parts->base,
! true, NULL_TREE);
if (parts->index)
parts->index = force_gimple_operand_bsi (bsi, parts->index,
! true, NULL_TREE);
}
/* Creates and returns a TARGET_MEM_REF for address ADDR. If necessary
--- 556,567 ----
{
if (parts->base)
parts->base = force_gimple_operand_bsi (bsi, parts->base,
! true, NULL_TREE,
! true, BSI_SAME_STMT);
if (parts->index)
parts->index = force_gimple_operand_bsi (bsi, parts->index,
! true, NULL_TREE,
! true, BSI_SAME_STMT);
}
/* Creates and returns a TARGET_MEM_REF for address ADDR. If necessary
*************** create_mem_ref (block_stmt_iterator *bsi
*** 588,594 ****
parts.index = force_gimple_operand_bsi (bsi,
fold_build2 (MULT_EXPR, sizetype,
parts.index, parts.step),
! true, NULL_TREE);
parts.step = NULL_TREE;
mem_ref = create_mem_ref_raw (type, &parts);
--- 590,596 ----
parts.index = force_gimple_operand_bsi (bsi,
fold_build2 (MULT_EXPR, sizetype,
parts.index, parts.step),
! true, NULL_TREE, true, BSI_SAME_STMT);
parts.step = NULL_TREE;
mem_ref = create_mem_ref_raw (type, &parts);
*************** create_mem_ref (block_stmt_iterator *bsi
*** 614,620 ****
fold_build2 (PLUS_EXPR, atype,
fold_convert (atype, parts.base),
tmp),
! true, NULL_TREE);
}
else
{
--- 616,622 ----
fold_build2 (PLUS_EXPR, atype,
fold_convert (atype, parts.base),
tmp),
! true, NULL_TREE, true, BSI_SAME_STMT);
}
else
{
*************** create_mem_ref (block_stmt_iterator *bsi
*** 641,647 ****
fold_build2 (PLUS_EXPR, atype,
parts.base,
fold_convert (atype, parts.index)),
! true, NULL_TREE);
}
else
parts.base = parts.index;
--- 643,649 ----
fold_build2 (PLUS_EXPR, atype,
parts.base,
fold_convert (atype, parts.index)),
! true, NULL_TREE, true, BSI_SAME_STMT);
}
else
parts.base = parts.index;
*************** create_mem_ref (block_stmt_iterator *bsi
*** 662,668 ****
fold_build2 (POINTER_PLUS_EXPR, atype,
parts.base,
fold_convert (sizetype, parts.offset)),
! true, NULL_TREE);
}
else
parts.base = parts.offset;
--- 664,670 ----
fold_build2 (POINTER_PLUS_EXPR, atype,
parts.base,
fold_convert (sizetype, parts.offset)),
! true, NULL_TREE, true, BSI_SAME_STMT);
}
else
parts.base = parts.offset;
Index: tree-ssa-ifcombine.c
===================================================================
*** tree-ssa-ifcombine.c (revision 125822)
--- tree-ssa-ifcombine.c (working copy)
*************** ifcombine_ifandif (basic_block inner_con
*** 312,320 ****
t2 = fold_build2 (LSHIFT_EXPR, TREE_TYPE (name1),
integer_one_node, bit2);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), t, t2);
! t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE);
t2 = fold_build2 (BIT_AND_EXPR, TREE_TYPE (name1), name1, t);
! t2 = force_gimple_operand_bsi (&bsi, t2, true, NULL_TREE);
COND_EXPR_COND (inner_cond) = fold_build2 (EQ_EXPR, boolean_type_node,
t2, t);
update_stmt (inner_cond);
--- 312,322 ----
t2 = fold_build2 (LSHIFT_EXPR, TREE_TYPE (name1),
integer_one_node, bit2);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), t, t2);
! t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE,
! true, BSI_SAME_STMT);
t2 = fold_build2 (BIT_AND_EXPR, TREE_TYPE (name1), name1, t);
! t2 = force_gimple_operand_bsi (&bsi, t2, true, NULL_TREE,
! true, BSI_SAME_STMT);
COND_EXPR_COND (inner_cond) = fold_build2 (EQ_EXPR, boolean_type_node,
t2, t);
update_stmt (inner_cond);
*************** ifcombine_iforif (basic_block inner_cond
*** 400,408 ****
/* Do it. */
bsi = bsi_for_stmt (inner_cond);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), bits1, bits2);
! t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE);
t = fold_build2 (BIT_AND_EXPR, TREE_TYPE (name1), name1, t);
! t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE);
COND_EXPR_COND (inner_cond) = fold_build2 (NE_EXPR, boolean_type_node, t,
build_int_cst (TREE_TYPE (t), 0));
update_stmt (inner_cond);
--- 402,412 ----
/* Do it. */
bsi = bsi_for_stmt (inner_cond);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), bits1, bits2);
! t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE,
! true, BSI_SAME_STMT);
t = fold_build2 (BIT_AND_EXPR, TREE_TYPE (name1), name1, t);
! t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE,
! true, BSI_SAME_STMT);
COND_EXPR_COND (inner_cond) = fold_build2 (NE_EXPR, boolean_type_node, t,
build_int_cst (TREE_TYPE (t), 0));
update_stmt (inner_cond);
Index: matrix-reorg.c
===================================================================
*** matrix-reorg.c (revision 125822)
--- matrix-reorg.c (working copy)
*************** compute_offset (HOST_WIDE_INT orig, HOST
*** 1708,1714 ****
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;
--- 1708,1713 ----
*************** transform_access_sites (void **slot, voi
*** 1831,1849 ****
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);
! }
}
else
tmp1 = offset;
--- 1830,1839 ----
total_elements = new_offset;
if (new_offset != offset)
{
! bsi = bsi_for_stmt (acc_info->stmt);
! tmp1 = force_gimple_operand_bsi (&bsi, total_elements,
! true, NULL,
! true, BSI_SAME_STMT);
}
else
tmp1 = offset;
*************** transform_access_sites (void **slot, voi
*** 1855,1872 ****
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);
! }
}
/* Replace the offset if needed. */
if (tmp1 != offset)
--- 1845,1854 ----
num_elements =
fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, acc_info->index),
fold_convert (sizetype, d_size));
add_referenced_var (d_size);
! 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)
*************** transform_allocation_sites (void **slot,
*** 1942,1948 ****
{
int i;
struct matrix_info *mi;
! tree type, call_stmt_0, malloc_stmt, oldfn, stmts, prev_dim_size, use_stmt;
struct cgraph_node *c_node;
struct cgraph_edge *e;
block_stmt_iterator bsi;
--- 1924,1930 ----
{
int i;
struct matrix_info *mi;
! 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;
*************** transform_allocation_sites (void **slot,
*** 2069,2075 ****
{
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. */
--- 2051,2056 ----
*************** transform_allocation_sites (void **slot,
*** 2099,2118 ****
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);
! }
/* 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);
prev_dim_size = mi->dimension_size[i] = dim_var;
}
--- 2080,2092 ----
dim_size = fold_build2 (MULT_EXPR, type, dim_size, prev_dim_size);
}
! 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_SAME_STMT);
prev_dim_size = mi->dimension_size[i] = dim_var;
}
*************** transform_allocation_sites (void **slot,
*** 2122,2138 ****
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);
! }
if (TREE_CODE (old_size_0) == SSA_NAME)
{
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, old_size_0)
--- 2096,2103 ----
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);
! 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)
Index: tree-if-conv.c
===================================================================
*** tree-if-conv.c (revision 125822)
--- tree-if-conv.c (working copy)
*************** add_to_dst_predicate_list (struct loop *
*** 630,646 ****
{
tree tmp;
tree tmp_stmt = NULL_TREE;
! tree tmp_stmts1 = NULL_TREE;
! tree tmp_stmts2 = NULL_TREE;
! prev_cond = force_gimple_operand (unshare_expr (prev_cond),
! &tmp_stmts1, true, NULL);
! if (tmp_stmts1)
! bsi_insert_before (bsi, tmp_stmts1, BSI_SAME_STMT);
!
! cond = force_gimple_operand (unshare_expr (cond),
! &tmp_stmts2, true, NULL);
! if (tmp_stmts2)
! bsi_insert_before (bsi, tmp_stmts2, BSI_SAME_STMT);
/* new_cond == prev_cond AND cond */
tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
--- 630,641 ----
{
tree tmp;
tree tmp_stmt = NULL_TREE;
!
! prev_cond = force_gimple_operand_bsi (bsi, unshare_expr (prev_cond),
! true, NULL, true, BSI_SAME_STMT);
!
! cond = force_gimple_operand_bsi (bsi, unshare_expr (cond),
! true, NULL, true, BSI_SAME_STMT);
/* new_cond == prev_cond AND cond */
tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
*************** find_phi_replacement_condition (struct l
*** 679,685 ****
{
basic_block first_bb = NULL;
basic_block second_bb = NULL;
! tree tmp_cond, new_stmts;
gcc_assert (EDGE_COUNT (bb->preds) == 2);
first_bb = (EDGE_PRED (bb, 0))->src;
--- 674,680 ----
{
basic_block first_bb = NULL;
basic_block second_bb = NULL;
! tree tmp_cond;
gcc_assert (EDGE_COUNT (bb->preds) == 2);
first_bb = (EDGE_PRED (bb, 0))->src;
*************** find_phi_replacement_condition (struct l
*** 745,753 ****
value as condition. Various targets use different means to communicate
condition in vector compare operation. Using gimple value allows compiler
to emit vector compare and select RTL without exposing compare's result. */
! *cond = force_gimple_operand (*cond, &new_stmts, false, NULL_TREE);
! if (new_stmts)
! bsi_insert_before (bsi, new_stmts, BSI_SAME_STMT);
if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond))
{
tree new_stmt;
--- 740,747 ----
value as condition. Various targets use different means to communicate
condition in vector compare operation. Using gimple value allows compiler
to emit vector compare and select RTL without exposing compare's result. */
! *cond = force_gimple_operand_bsi (bsi, *cond, false, NULL_TREE,
! true, BSI_SAME_STMT);
if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond))
{
tree new_stmt;
Index: gimplify.c
===================================================================
*** gimplify.c (revision 125822)
--- gimplify.c (working copy)
*************** force_gimple_operand (tree expr, tree *s
*** 6555,6571 ****
}
/* Invokes force_gimple_operand for EXPR with parameters SIMPLE_P and VAR. If
! some statements are produced, emits them before BSI. */
tree
force_gimple_operand_bsi (block_stmt_iterator *bsi, tree expr,
! bool simple_p, tree var)
{
tree stmts;
expr = force_gimple_operand (expr, &stmts, simple_p, var);
if (stmts)
! bsi_insert_before (bsi, stmts, BSI_SAME_STMT);
return expr;
}
--- 6555,6588 ----
}
/* Invokes force_gimple_operand for EXPR with parameters SIMPLE_P and VAR. If
! some statements are produced, emits them at BSI. If BEFORE is true.
! the statements are appended before BSI, otherwise they are appended after
! it. M specifies the way BSI moves after insertion (BSI_SAME_STMT or
! BSI_CONTINUE_LINKING are the usual values). */
tree
force_gimple_operand_bsi (block_stmt_iterator *bsi, tree expr,
! bool simple_p, tree var, bool before,
! enum bsi_iterator_update m)
{
tree stmts;
expr = force_gimple_operand (expr, &stmts, simple_p, var);
if (stmts)
! {
! if (gimple_in_ssa_p (cfun))
! {
! tree_stmt_iterator tsi;
!
! for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
! mark_symbols_for_renaming (tsi_stmt (tsi));
! }
!
! if (before)
! bsi_insert_before (bsi, stmts, m);
! else
! bsi_insert_after (bsi, stmts, m);
! }
return expr;
}
Index: tree-ssa-loop-prefetch.c
===================================================================
*** tree-ssa-loop-prefetch.c (revision 125822)
--- tree-ssa-loop-prefetch.c (working copy)
*************** issue_prefetch_ref (struct mem_ref *ref,
*** 883,889 ****
n_prefetches = ((unroll_factor + ref->prefetch_mod - 1)
/ ref->prefetch_mod);
addr_base = build_fold_addr_expr_with_type (ref->mem, ptr_type_node);
! addr_base = force_gimple_operand_bsi (&bsi, unshare_expr (addr_base), true, NULL);
write_p = ref->write_p ? integer_one_node : integer_zero_node;
local = build_int_cst (integer_type_node, nontemporal ? 0 : 3);
--- 883,890 ----
n_prefetches = ((unroll_factor + ref->prefetch_mod - 1)
/ ref->prefetch_mod);
addr_base = build_fold_addr_expr_with_type (ref->mem, ptr_type_node);
! addr_base = force_gimple_operand_bsi (&bsi, unshare_expr (addr_base),
! true, NULL, true, BSI_SAME_STMT);
write_p = ref->write_p ? integer_one_node : integer_zero_node;
local = build_int_cst (integer_type_node, nontemporal ? 0 : 3);
*************** issue_prefetch_ref (struct mem_ref *ref,
*** 893,899 ****
delta = (ahead + ap * ref->prefetch_mod) * ref->group->step;
addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node,
addr_base, size_int (delta));
! addr = force_gimple_operand_bsi (&bsi, unshare_expr (addr), true, NULL);
/* Create the prefetch instruction. */
prefetch = build_call_expr (built_in_decls[BUILT_IN_PREFETCH],
--- 894,901 ----
delta = (ahead + ap * ref->prefetch_mod) * ref->group->step;
addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node,
addr_base, size_int (delta));
! addr = force_gimple_operand_bsi (&bsi, unshare_expr (addr), true, NULL,
! true, BSI_SAME_STMT);
/* Create the prefetch instruction. */
prefetch = build_call_expr (built_in_decls[BUILT_IN_PREFETCH],
Index: lambda-code.c
===================================================================
*** lambda-code.c (revision 125822)
--- lambda-code.c (working copy)
*************** replace_uses_equiv_to_x_with_y (struct l
*** 2058,2064 ****
which sets Y. */
var = create_tmp_var (TREE_TYPE (use), "perfecttmp");
add_referenced_var (var);
! val = force_gimple_operand_bsi (firstbsi, val, false, NULL);
setstmt = build_gimple_modify_stmt (var, val);
var = make_ssa_name (var, setstmt);
GIMPLE_STMT_OPERAND (setstmt, 0) = var;
--- 2058,2065 ----
which sets Y. */
var = create_tmp_var (TREE_TYPE (use), "perfecttmp");
add_referenced_var (var);
! val = force_gimple_operand_bsi (firstbsi, val, false, NULL,
! true, BSI_SAME_STMT);
setstmt = build_gimple_modify_stmt (var, val);
var = make_ssa_name (var, setstmt);
GIMPLE_STMT_OPERAND (setstmt, 0) = var;
Index: tree-vect-transform.c
===================================================================
*** tree-vect-transform.c (revision 125822)
--- tree-vect-transform.c (working copy)
*************** vect_update_ivs_after_vectorizer (loop_v
*** 5232,5238 ****
tree evolution_part;
tree init_expr;
tree step_expr;
! tree var, stmt, ni, ni_name;
block_stmt_iterator last_bsi;
if (vect_print_dump_info (REPORT_DETAILS))
--- 5232,5238 ----
tree evolution_part;
tree init_expr;
tree step_expr;
! tree var, ni, ni_name;
block_stmt_iterator last_bsi;
if (vect_print_dump_info (REPORT_DETAILS))
*************** vect_update_ivs_after_vectorizer (loop_v
*** 5290,5302 ****
var = create_tmp_var (TREE_TYPE (init_expr), "tmp");
add_referenced_var (var);
- ni_name = force_gimple_operand (ni, &stmt, false, var);
-
- /* Insert stmt into exit_bb. */
last_bsi = bsi_last (exit_bb);
! if (stmt)
! bsi_insert_before (&last_bsi, stmt, BSI_SAME_STMT);
!
/* Fix phi expressions in the successor bb. */
SET_PHI_ARG_DEF (phi1, update_e->dest_idx, ni_name);
}
--- 5290,5299 ----
var = create_tmp_var (TREE_TYPE (init_expr), "tmp");
add_referenced_var (var);
last_bsi = bsi_last (exit_bb);
! ni_name = force_gimple_operand_bsi (&last_bsi, ni, false, var,
! true, BSI_SAME_STMT);
!
/* Fix phi expressions in the successor bb. */
SET_PHI_ARG_DEF (phi1, update_e->dest_idx, ni_name);
}
Index: tree-profile.c
===================================================================
*** tree-profile.c (revision 125822)
--- tree-profile.c (working copy)
*************** prepare_instrumented_value (block_stmt_i
*** 192,198 ****
{
tree val = value->hvalue.value;
return force_gimple_operand_bsi (bsi, fold_convert (gcov_type_node, val),
! true, NULL_TREE);
}
/* Output instructions as GIMPLE trees to increment the interval histogram
--- 192,198 ----
{
tree val = value->hvalue.value;
return force_gimple_operand_bsi (bsi, fold_convert (gcov_type_node, val),
! true, NULL_TREE, true, BSI_SAME_STMT);
}
/* Output instructions as GIMPLE trees to increment the interval histogram
*************** tree_gen_interval_profiler (histogram_va
*** 211,217 ****
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_interval_profiler_fn, 4,
ref_ptr, val, start, steps);
--- 211,217 ----
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE, true, BSI_SAME_STMT);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_interval_profiler_fn, 4,
ref_ptr, val, start, steps);
*************** tree_gen_pow2_profiler (histogram_value
*** 232,238 ****
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_pow2_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
--- 232,238 ----
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE, true, BSI_SAME_STMT);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_pow2_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
*************** tree_gen_one_value_profiler (histogram_v
*** 252,258 ****
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_one_value_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
--- 252,258 ----
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE, true, BSI_SAME_STMT);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_one_value_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
*************** tree_gen_ic_profiler (histogram_value va
*** 275,281 ****
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE);
/* Insert code:
--- 275,281 ----
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE, true, BSI_SAME_STMT);
/* Insert code:
*************** tree_gen_ic_func_profiler (void)
*** 325,331 ****
cur_func = force_gimple_operand_bsi (&bsi,
build_addr (current_function_decl,
current_function_decl),
! true, NULL_TREE);
tree_uid = build_int_cst (gcov_type_node, c_node->pid);
stmt1 = build_call_expr (tree_indirect_call_profiler_fn, 4,
ic_gcov_type_ptr_var,
--- 325,332 ----
cur_func = force_gimple_operand_bsi (&bsi,
build_addr (current_function_decl,
current_function_decl),
! true, NULL_TREE,
! true, BSI_SAME_STMT);
tree_uid = build_int_cst (gcov_type_node, c_node->pid);
stmt1 = build_call_expr (tree_indirect_call_profiler_fn, 4,
ic_gcov_type_ptr_var,
*************** tree_gen_average_profiler (histogram_val
*** 367,373 ****
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_average_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
--- 368,375 ----
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE,
! true, BSI_SAME_STMT);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_average_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
*************** tree_gen_ior_profiler (histogram_value v
*** 387,393 ****
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_ior_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
--- 389,395 ----
ref_ptr = force_gimple_operand_bsi (&bsi,
build_addr (ref, current_function_decl),
! true, NULL_TREE, true, BSI_SAME_STMT);
val = prepare_instrumented_value (&bsi, value);
call = build_call_expr (tree_ior_profiler_fn, 2, ref_ptr, val);
bsi_insert_before (&bsi, call, BSI_SAME_STMT);
Index: tree-flow.h
===================================================================
*** tree-flow.h (revision 125822)
--- tree-flow.h (working copy)
*************** extern void register_jump_thread (edge,
*** 1123,1129 ****
/* In gimplify.c */
tree force_gimple_operand (tree, tree *, bool, tree);
! tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree);
/* In tree-ssa-structalias.c */
bool find_what_p_points_to (tree);
--- 1123,1130 ----
/* In gimplify.c */
tree force_gimple_operand (tree, tree *, bool, tree);
! tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree,
! bool, enum bsi_iterator_update);
/* In tree-ssa-structalias.c */
bool find_what_p_points_to (tree);
Index: tree-ssa-reassoc.c
===================================================================
*** tree-ssa-reassoc.c (revision 125822)
--- tree-ssa-reassoc.c (working copy)
*************** negate_value (tree tonegate, block_stmt_
*** 1026,1032 ****
tonegate = fold_build1 (NEGATE_EXPR, TREE_TYPE (tonegate), tonegate);
resultofnegate = force_gimple_operand_bsi (bsi, tonegate, true,
! NULL_TREE);
VEC_safe_push (tree, heap, broken_up_subtracts, resultofnegate);
return resultofnegate;
--- 1026,1032 ----
tonegate = fold_build1 (NEGATE_EXPR, TREE_TYPE (tonegate), tonegate);
resultofnegate = force_gimple_operand_bsi (bsi, tonegate, true,
! NULL_TREE, true, BSI_SAME_STMT);
VEC_safe_push (tree, heap, broken_up_subtracts, resultofnegate);
return resultofnegate;