/* Post reload partially redundant load elimination
- Copyright (C) 2004, 2005, 2006, 2007
+ Copyright (C) 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
const struct expr *const exp1 = (const struct expr *) exp1p;
const struct expr *const exp2 = (const struct expr *) exp2p;
int equiv_p = exp_equiv_p (exp1->expr, exp2->expr, 0, true);
-
+
gcc_assert (!equiv_p || exp1->hash == exp2->hash);
return equiv_p;
}
slot = (struct expr **) htab_find_slot_with_hash (expr_table, cur_expr,
hash, INSERT);
-
+
if (! (*slot))
/* The expression isn't found, so insert it. */
*slot = cur_expr;
/* Search for another occurrence in the same basic block. */
avail_occr = cur_expr->avail_occr;
- while (avail_occr && BLOCK_NUM (avail_occr->insn) != BLOCK_NUM (insn))
+ while (avail_occr
+ && BLOCK_FOR_INSN (avail_occr->insn) != BLOCK_FOR_INSN (insn))
{
/* If an occurrence isn't found, save a pointer to the end of
the list. */
}
}
- if (! CONST_OR_PURE_CALL_P (insn))
+ if (! RTL_CONST_OR_PURE_CALL_P (insn))
record_last_mem_set_info (insn);
}
}
avail_insn = a_occr->insn;
avail_reg = get_avail_load_store_reg (avail_insn);
gcc_assert (avail_reg);
-
+
/* Make sure we can generate a move from register avail_reg to
dest. */
extract_insn (gen_move_insn (copy_rtx (dest),
if (/* No load can be replaced by copy. */
npred_ok == 0
- /* Prevent exploding the code. */
- || (optimize_size && npred_ok > 1)
- /* If we don't have profile information we cannot tell if splitting
+ /* Prevent exploding the code. */
+ || (optimize_bb_for_size_p (bb) && npred_ok > 1)
+ /* If we don't have profile information we cannot tell if splitting
a critical edge is profitable or not so don't do it. */
|| ((! profile_info || ! flag_branch_probabilities
|| targetm.cannot_modify_jumps_p ())
continue;
/* Do not try anything on cold basic blocks. */
- if (probably_cold_bb_p (bb))
+ if (optimize_bb_for_size_p (bb))
continue;
/* Reset the table of things changed since the start of the current
memset (&stats, 0, sizeof (stats));
- /* Allocate ememory for this pass.
+ /* Allocate memory for this pass.
Also computes and initializes the insns' CUIDs. */
alloc_mem ();
fprintf (dump_file, "\n\n");
}
}
-
+
/* We are finished with alias. */
end_alias_analysis ();
static bool
gate_handle_gcse2 (void)
{
- return (optimize > 0 && flag_gcse_after_reload);
+ return (optimize > 0 && flag_gcse_after_reload
+ && optimize_function_for_speed_p (cfun));
}
return 0;
}
-struct tree_opt_pass pass_gcse2 =
+struct rtl_opt_pass pass_gcse2 =
{
+ {
+ RTL_PASS,
"gcse2", /* name */
gate_handle_gcse2, /* gate */
rest_of_handle_gcse2, /* execute */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_func | TODO_verify_rtl_sharing
- | TODO_verify_flow | TODO_ggc_collect,/* todo_flags_finish */
- 'J' /* letter */
+ | TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */
+ }
};