predecessor a node that writes to memory. */
static bitmap upstream_mem_writes;
-/* TODOs we need to run after the pass. */
-static unsigned int todo;
-
/* Update the PHI nodes of NEW_LOOP. NEW_LOOP is a duplicate of
ORIG_LOOP. */
return true;
}
-/* Build size argument. */
+/* Build the size argument for a memset call. */
static inline tree
build_size_arg (tree nb_iter, tree op, gimple_seq* stmt_list)
tree nb_bytes;
gimple_seq stmts = NULL;
- nb_bytes = fold_build2 (MULT_EXPR, TREE_TYPE (nb_iter),
- nb_iter, TYPE_SIZE_UNIT (TREE_TYPE (op)));
+ nb_bytes = fold_build2 (MULT_EXPR, size_type_node,
+ fold_convert (size_type_node, nb_iter),
+ fold_convert (size_type_node,
+ TYPE_SIZE_UNIT (TREE_TYPE (op))));
nb_bytes = force_gimple_operand (nb_bytes, &stmts, true, NULL);
gimple_seq_add_seq (stmt_list, stmts);
generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
gimple_stmt_iterator bsi)
{
- tree t, addr_base;
+ tree addr_base;
tree nb_bytes = NULL;
bool res = false;
gimple_seq stmts = NULL, stmt_list = NULL;
gimple fn_call;
tree mem, fndecl, fntype, fn;
gimple_stmt_iterator i;
- ssa_op_iter iter;
struct data_reference *dr = XCNEW (struct data_reference);
DR_STMT (dr) = stmt;
{
nb_bytes = build_size_arg (nb_iter, op0, &stmt_list);
addr_base = size_binop (PLUS_EXPR, DR_OFFSET (dr), DR_INIT (dr));
- addr_base = fold_build2 (MINUS_EXPR, sizetype, addr_base, nb_bytes);
+ addr_base = fold_build2 (MINUS_EXPR, sizetype, addr_base,
+ fold_convert (sizetype, nb_bytes));
addr_base = force_gimple_operand (addr_base, &stmts, true, NULL);
gimple_seq_add_seq (&stmt_list, stmts);
fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
if (!nb_bytes)
- nb_bytes = build_size_arg (nb_iter, op0, &stmt_list);
+ nb_bytes = build_size_arg (nb_iter, op0, &stmt_list);
fn_call = gimple_build_call (fn, 3, mem, integer_zero_node, nb_bytes);
gimple_seq_add_stmt (&stmt_list, fn_call);
{
gimple s = gsi_stmt (i);
update_stmt_if_modified (s);
-
- FOR_EACH_SSA_TREE_OPERAND (t, s, iter, SSA_OP_VIRTUAL_DEFS)
- {
- if (TREE_CODE (t) == SSA_NAME)
- t = SSA_NAME_VAR (t);
- mark_sym_for_renaming (t);
- }
- }
-
- /* Mark also the uses of the VDEFS of STMT to be renamed. */
- FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, SSA_OP_VIRTUAL_DEFS)
- {
- if (TREE_CODE (t) == SSA_NAME)
- {
- gimple s;
- imm_use_iterator imm_iter;
-
- FOR_EACH_IMM_USE_STMT (s, imm_iter, t)
- update_stmt (s);
-
- t = SSA_NAME_VAR (t);
- }
- mark_sym_for_renaming (t);
}
gsi_insert_seq_after (&bsi, stmt_list, GSI_CONTINUE_LINKING);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "generated memset zero\n");
- todo |= TODO_rebuild_alias;
-
end:
free_data_ref (dr);
return res;
rdg_flag_uses (struct graph *rdg, int u, bitmap partition, bitmap loops,
bitmap processed, bool *part_has_writes)
{
- ssa_op_iter iter;
use_operand_p use_p;
struct vertex *x = &(rdg->vertices[u]);
gimple stmt = RDGV_STMT (x);
if (gimple_code (stmt) != GIMPLE_PHI)
{
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_VIRTUAL_USES)
+ if ((use_p = gimple_vuse_op (stmt)) != NULL_USE_OPERAND_P)
{
tree use = USE_FROM_PTR (use_p);
loop_iterator li;
int nb_generated_loops = 0;
- todo = 0;
-
FOR_EACH_LOOP (li, loop, 0)
{
VEC (gimple, heap) *work_list = VEC_alloc (gimple, heap, 3);
VEC_free (gimple, heap, work_list);
}
- return todo;
+ return 0;
}
static bool