Commit b2077fd2 by Jan Hubicka Committed by Jan Hubicka

i386.h (ix86_size_cost): Declare.


	* i386.h (ix86_size_cost): Declare.
	(ix86_cur_cost): New function macro.
	* i386.md (peepholes expanding size and splitters): Predicate by
	optimize_insn_for_speed_p.
	(peepholes reduce size and splitters): Predicate by
	optimize_insn_for_size_p.
	* i386.c (ix86_size_cost): Rename from ...
	(size_cost): This one.
	(override_options): Update.
	(decide_alg): Likewise.
	(ix86_expand_clear): Use RTL profile.
	(ix86_pad_returns): Use RTL profile.

From-SVN: r138864
parent a8ba47cb
2008-08-07 Jan Hubicka <jh@suse.cz> 2008-08-07 Jan Hubicka <jh@suse.cz>
* i386.h (ix86_size_cost): Declare.
(ix86_cur_cost): New function macro.
* i386.md (peepholes expanding size and splitters): Predicate by
optimize_insn_for_speed_p.
(peepholes reduce size and splitters): Predicate by
optimize_insn_for_size_p.
* i386.c (ix86_size_cost): Rename from ...
(size_cost): This one.
(override_options): Update.
(decide_alg): Likewise.
(ix86_expand_clear): Use RTL profile.
(ix86_pad_returns): Use RTL profile.
2008-08-07 Jan Hubicka <jh@suse.cz>
* recog.c (split_all_insns): Set RTL profile * recog.c (split_all_insns): Set RTL profile
(peephole2_optimize): Likewise. (peephole2_optimize): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise.
......
...@@ -75,8 +75,8 @@ static rtx legitimize_dllimport_symbol (rtx, bool); ...@@ -75,8 +75,8 @@ static rtx legitimize_dllimport_symbol (rtx, bool);
#define DUMMY_STRINGOP_ALGS {libcall, {{-1, libcall}}} #define DUMMY_STRINGOP_ALGS {libcall, {{-1, libcall}}}
static const const
struct processor_costs size_cost = { /* costs for tuning for size */ struct processor_costs ix86_size_cost = {/* costs for tuning for size */
COSTS_N_BYTES (2), /* cost of an add instruction */ COSTS_N_BYTES (2), /* cost of an add instruction */
COSTS_N_BYTES (3), /* cost of a lea instruction */ COSTS_N_BYTES (3), /* cost of a lea instruction */
COSTS_N_BYTES (2), /* variable shift costs */ COSTS_N_BYTES (2), /* variable shift costs */
...@@ -2841,7 +2841,7 @@ override_options (bool main_args_p) ...@@ -2841,7 +2841,7 @@ override_options (bool main_args_p)
ix86_tune_features[i] = !!(initial_ix86_tune_features[i] & ix86_tune_mask); ix86_tune_features[i] = !!(initial_ix86_tune_features[i] & ix86_tune_mask);
if (optimize_size) if (optimize_size)
ix86_cost = &size_cost; ix86_cost = &ix86_size_cost;
else else
ix86_cost = processor_target_table[ix86_tune].cost; ix86_cost = processor_target_table[ix86_tune].cost;
...@@ -11541,7 +11541,7 @@ ix86_expand_clear (rtx dest) ...@@ -11541,7 +11541,7 @@ ix86_expand_clear (rtx dest)
tmp = gen_rtx_SET (VOIDmode, dest, const0_rtx); tmp = gen_rtx_SET (VOIDmode, dest, const0_rtx);
/* This predicate should match that for movsi_xor and movdi_xor_rex64. */ /* This predicate should match that for movsi_xor and movdi_xor_rex64. */
if (reload_completed && (!TARGET_USE_MOV0 || optimize_size)) if (reload_completed && (!TARGET_USE_MOV0 || optimize_insn_for_speed_p ()))
{ {
rtx clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG)); rtx clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG));
tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob)); tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob));
...@@ -16632,7 +16632,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset, ...@@ -16632,7 +16632,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset,
&& alg != rep_prefix_8_byte)) && alg != rep_prefix_8_byte))
const struct processor_costs *cost; const struct processor_costs *cost;
cost = optimize_insn_for_size_p () ? &size_cost : ix86_cost; cost = optimize_insn_for_size_p () ? &ix86_size_cost : ix86_cost;
*dynamic_check = -1; *dynamic_check = -1;
if (memset) if (memset)
...@@ -24828,7 +24828,7 @@ ix86_pad_returns (void) ...@@ -24828,7 +24828,7 @@ ix86_pad_returns (void)
bool replace = false; bool replace = false;
if (!JUMP_P (ret) || GET_CODE (PATTERN (ret)) != RETURN if (!JUMP_P (ret) || GET_CODE (PATTERN (ret)) != RETURN
|| !maybe_hot_bb_p (bb)) || optimize_bb_for_size_p (bb))
continue; continue;
for (prev = PREV_INSN (ret); prev; prev = PREV_INSN (prev)) for (prev = PREV_INSN (ret); prev; prev = PREV_INSN (prev))
if (active_insn_p (prev) || LABEL_P (prev)) if (active_insn_p (prev) || LABEL_P (prev))
......
...@@ -170,6 +170,10 @@ struct processor_costs { ...@@ -170,6 +170,10 @@ struct processor_costs {
}; };
extern const struct processor_costs *ix86_cost; extern const struct processor_costs *ix86_cost;
extern const struct processor_costs ix86_size_cost;
#define ix86_cur_cost() \
(optimize_insn_for_size_p () ? &ix86_size_cost: ix86_cost)
/* Macros used in the machine description to test the flags. */ /* Macros used in the machine description to test the flags. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment