diff options
author | Jan Hubicka <jh@suse.cz> | 2008-09-01 09:27:39 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2008-09-01 09:27:39 +0000 |
commit | e04ad03daeeb2f8120bd399d54563f085035391d (patch) | |
tree | c411e2176e124778ff2eefc610f88cabc4e42a85 /gcc/config | |
parent | e855c69d162c023bae5236ea75bab646c5e84fed (diff) | |
download | gcc-e04ad03daeeb2f8120bd399d54563f085035391d.zip gcc-e04ad03daeeb2f8120bd399d54563f085035391d.tar.gz gcc-e04ad03daeeb2f8120bd399d54563f085035391d.tar.bz2 |
expr.c (MOVE_BY_PIECES_P, [...]): Pass speed operand.
* expr.c (MOVE_BY_PIECES_P, CLEAR_BY_PIECES_P, SET_BY_PIECES_P): Pass speed operand.
* expr.h (MOVE_RATIO, CLEAR_RATIO, SET_RATIO): Update.
* gimplify.c (gimplify_init_constructor): Add speed operand.
* tree-sra.c (decide_block_copy): Likewise.
* tree-inline.c (estimate_move_cost): Likewise.
* config/alpha/alpha.h (MOVE_RATIO): Update.
* config/frv/frv.c (MOVE_RATIO): Update.
* config/spu/spu.h (MOVE_RATIO): Update.
* config/sparc/sparc.h (MOVE_RATIO): Update.
* config/i386/i386.h (MOVE_RATIO, CLEAR_RATIO): Update.
* config/m68hc11/m68hc11.h (MOVE_RATIO): Update.
* config/cris/cris.h (MOVE_RATIO): Update.
* config/mn10300/mn10300.h (MOVE_RATIO): Update.
* config/arm/arm.h (MOVE_RATIO): Update.
* config/pa/pa.md: Update uses of MOVE_RATIO
* config/pa/pa.h (MOVE_RATIO): Update.
* config/mips/mips.h (MOVE_RATIO, MOVE_BY_PIECES, CLEAR_RATIO, SET_RATIO): Update.
* config/h8300/h8300.h (MOVE_RATIO): Update.
* config/v850/v850.h (MOVE_RATIO): Update.
* config/bfin/bfin.h (MOVE_RATIO): Update.
From-SVN: r139855
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/alpha.h | 2 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 2 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.h | 2 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 2 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.h | 4 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 4 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 12 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.h | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 8 | ||||
-rw-r--r-- | gcc/config/s390/s390.h | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 2 | ||||
-rw-r--r-- | gcc/config/spu/spu.h | 2 | ||||
-rw-r--r-- | gcc/config/v850/v850.h | 2 |
15 files changed, 24 insertions, 26 deletions
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 8e022d6..c462f71 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -1079,7 +1079,7 @@ do { \ Without byte/word accesses, we want no more than four instructions; with, several single byte accesses are better. */ -#define MOVE_RATIO (TARGET_BWX ? 7 : 2) +#define MOVE_RATIO(speed) (TARGET_BWX ? 7 : 2) /* Largest number of bytes of an object that can be placed in a register. On the Alpha we have plenty of registers, so use TImode. */ diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 4132b06..a8820cb 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2244,7 +2244,7 @@ do { \ #define MOVE_MAX 4 #undef MOVE_RATIO -#define MOVE_RATIO (arm_tune_xscale ? 4 : 2) +#define MOVE_RATIO(speed) (arm_tune_xscale ? 4 : 2) /* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */ diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index 826e60b..4ac369f 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -998,7 +998,7 @@ do { \ /* If a memory-to-memory move would take MOVE_RATIO or more simple move-instruction pairs, we will do a movmem or libcall instead. */ -#define MOVE_RATIO 5 +#define MOVE_RATIO(speed) 5 /* STORAGE LAYOUT: target machine storage layout Define this macro as a C expression which is nonzero if accessing diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index b8a66e9..ed1ec3d 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1242,7 +1242,7 @@ struct cum_args {int regs;}; word-length sizes will be emitted. The "9" will translate to (9 - 1) * 4 = 32 bytes maximum moved, but using 16 instructions (8 instruction sequences) or less. */ -#define MOVE_RATIO 9 +#define MOVE_RATIO(speed) 9 /* Node: Sections */ diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 7305fc3..4edbb2f 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -1189,10 +1189,8 @@ struct cum_arg #define FINAL_PRESCAN_INSN(insn, operand, nop) \ final_prescan_insn (insn, operand, nop) -#define MOVE_RATIO 3 extern int h8300_move_ratio; -#undef MOVE_RATIO -#define MOVE_RATIO h8300_move_ratio +#define MOVE_RATIO(speed) h8300_move_ratio /* Machine-specific symbol_ref flags. */ #define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0) diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index d933c5e..cb1dca7 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1906,12 +1906,12 @@ do { \ If you don't define this, a reasonable default is used. */ -#define MOVE_RATIO (optimize_size ? 3 : ix86_cost->move_ratio) +#define MOVE_RATIO(speed) ((speed) ? ix86_cost->move_ratio : 3) /* If a clear memory operation would take CLEAR_RATIO or more simple move-instruction sequences, we will do a clrmem or libcall instead. */ -#define CLEAR_RATIO (optimize_size ? 2 : MIN (6, ix86_cost->move_ratio)) +#define CLEAR_RATIO(speed) ((speed) ? MIN (6, ix86_cost->move_ratio) : 2) /* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h index cb789e1..302c414 100644 --- a/gcc/config/m68hc11/m68hc11.h +++ b/gcc/config/m68hc11/m68hc11.h @@ -1505,7 +1505,7 @@ do { \ /* MOVE_RATIO is the number of move instructions that is better than a block move. Make this small on 6811, since the code size grows very large with each move. */ -#define MOVE_RATIO 3 +#define MOVE_RATIO(speed) 3 /* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension of a shift count. */ diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index e008e80..86b886a 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2940,7 +2940,7 @@ while (0) we'll have to generate a load/store pair for each, halve the value of MIPS_CALL_RATIO to take that into account. */ -#define MOVE_RATIO \ +#define MOVE_RATIO(speed) \ (HAVE_movmemsi \ ? MIPS_MAX_MOVE_BYTES_STRAIGHT / MOVE_MAX \ : MIPS_CALL_RATIO / 2) @@ -2961,20 +2961,20 @@ while (0) ? (SIZE) < UNITS_PER_WORD \ : (SIZE) <= MIPS_MAX_MOVE_BYTES_STRAIGHT)) \ : (move_by_pieces_ninsns (SIZE, ALIGN, MOVE_MAX_PIECES + 1) \ - < (unsigned int) MOVE_RATIO)) + < (unsigned int) MOVE_RATIO (false))) /* For CLEAR_RATIO, when optimizing for size, give a better estimate of the length of a memset call, but use the default otherwise. */ -#define CLEAR_RATIO \ - (optimize_size ? MIPS_CALL_RATIO : 15) +#define CLEAR_RATIO(speed)\ + ((speed) ? 15 : MIPS_CALL_RATIO) /* This is similar to CLEAR_RATIO, but for a non-zero constant, so when optimizing for size adjust the ratio to account for the overhead of loading the constant and replicating it across the word. */ -#define SET_RATIO \ - (optimize_size ? MIPS_CALL_RATIO - 2 : 15) +#define SET_RATIO(speed) \ + ((speed) ? 15 : MIPS_CALL_RATIO - 2) /* STORE_BY_PIECES_P can be used when copying a constant string, but in that case each word takes 3 insns (lui, ori, sw), or more in diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 07035fb..c1c8057 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -814,7 +814,7 @@ while (0) /* According expr.c, a value of around 6 should minimize code size, and for the MN10300 series, that's our primary concern. */ -#define MOVE_RATIO 6 +#define MOVE_RATIO(speed) 6 #define TEXT_SECTION_ASM_OP "\t.section .text" #define DATA_SECTION_ASM_OP "\t.section .data" diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 5e272a2..2966a42 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1506,7 +1506,7 @@ do { \ arguments passed in registers to avoid infinite recursion during argument setup for a function call. Why? Consider how we copy the stack slots reserved for parameters when they may be trashed by a call. */ -#define MOVE_RATIO (TARGET_64BIT ? 8 : 4) +#define MOVE_RATIO(speed) (TARGET_64BIT ? 8 : 4) /* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */ diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index c3d686d..b50ab4c 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -3487,7 +3487,7 @@ FAIL; /* This does happen, but not often enough to worry much about. */ - if (size / align < MOVE_RATIO) + if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ())) FAIL; /* Fall through means we're going to use our block move pattern. */ @@ -3675,7 +3675,7 @@ FAIL; /* This does happen, but not often enough to worry much about. */ - if (size / align < MOVE_RATIO) + if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ())) FAIL; /* Fall through means we're going to use our block move pattern. */ @@ -3842,7 +3842,7 @@ FAIL; /* This does happen, but not often enough to worry much about. */ - if (size / align < MOVE_RATIO) + if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ())) FAIL; /* Fall through means we're going to use our block clear pattern. */ @@ -3956,7 +3956,7 @@ FAIL; /* This does happen, but not often enough to worry much about. */ - if (size / align < MOVE_RATIO) + if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ())) FAIL; /* Fall through means we're going to use our block clear pattern. */ diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index a31efd2..32ec036 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -872,7 +872,7 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1, *s390_compare_emitte in tree-sra with UNITS_PER_WORD to make a decision so we adjust it here to compensate for that factor since mvc costs exactly the same on 31 and 64 bit. */ -#define MOVE_RATIO (TARGET_64BIT? 2 : 4) +#define MOVE_RATIO(speed) (TARGET_64BIT? 2 : 4) /* Sections. */ diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index c4910a2..2e39082 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2099,7 +2099,7 @@ do { \ /* If a memory-to-memory move would take MOVE_RATIO or more simple move-instruction pairs, we will do a movmem or libcall instead. */ -#define MOVE_RATIO (optimize_size ? 3 : 8) +#define MOVE_RATIO(speed) ((speed) ? 8 : 3) /* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */ diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h index f78eb73..9839822 100644 --- a/gcc/config/spu/spu.h +++ b/gcc/config/spu/spu.h @@ -438,7 +438,7 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \ #define SLOW_BYTE_ACCESS 0 -#define MOVE_RATIO 32 +#define MOVE_RATIO(speed) 32 #define NO_FUNCTION_CSE diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index c897b12..65e731f 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -865,7 +865,7 @@ do { \ /* According expr.c, a value of around 6 should minimize code size, and for the V850 series, that's our primary concern. */ -#define MOVE_RATIO 6 +#define MOVE_RATIO(speed) 6 /* Indirect calls are expensive, never turn a direct call into an indirect call. */ |