summaryrefslogtreecommitdiff
path: root/gcc/reginfo.c
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-05 17:27:51 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-05 17:27:51 +0000
commit251a613eb0d8871e5d961286b66ce27f1d5ab58b (patch)
tree5acbb363779f56a111143ed54e7f8d18e54e8448 /gcc/reginfo.c
parent4c170941ee7ac668687d0df2b619be6fc9646c62 (diff)
downloadgcc-251a613eb0d8871e5d961286b66ce27f1d5ab58b.tar.gz
* target.h (struct gcc_target): Add memory_move_cost field.
* target-def.h (TARGET_MEMORY_MOVE_COST): New. (TARGET_INITIALIZER): Use TARGET_MEMORY_MOVE_COST. * targhooks.c (default_memory_move_cost): New function. * targhooks.h (default_memory_move_cost): Declare function. * reload.h (memory_move_cost): Declare. (memory_move_secondary_cost): Change type of 'in' argument to bool. * reginfo.c (memory_move_cost): New function. (memory_move_secondary_cost): Change type of 'in' argument to bool. * ira.h (ira_memory_move_cost): Update comment. * ira.c: (ira_memory_move_cost): Update comment. (setup_class_subset_and_memory_move_costs): Replace MEMORY_MOVE_COST with memory_move_cost. * postreload.c (reload_cse_simplify_set): (Ditto.). * reload1.c (choose_reload_regs): (Ditto.). * doc/tm.texi (TARGET_MEMORY_MOVE_COST): New. (MEMORY_MOVE_COST): Revise documentation. * config/i386/i386.h (MEMORY_MOVE_COST): Remove macro. * config/i386/i386-protos.h (int ix86_memory_move_cost): Remove. * config/i386/i386.h (ix86_memory_move_cost): Make static. Change type of 'in' argument to bool. (TARGET_MEMORY_MOVE_COST): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160323 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reginfo.c')
-rw-r--r--gcc/reginfo.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 4cfcf843a05..66e774a30c2 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -681,12 +681,18 @@ init_fake_stack_mems (void)
top_of_stack[i] = gen_rtx_MEM ((enum machine_mode) i, stack_pointer_rtx);
}
+/* Compute cost of moving registers to/from memory. */
+int
+memory_move_cost (enum machine_mode mode, enum reg_class rclass, bool in)
+{
+ return targetm.memory_move_cost (mode, rclass, in);
+}
/* Compute extra cost of moving registers to/from memory due to reloads.
Only needed if secondary reloads are required for memory moves. */
int
memory_move_secondary_cost (enum machine_mode mode, enum reg_class rclass,
- int in)
+ bool in)
{
enum reg_class altclass;
int partial_cost = 0;
@@ -706,8 +712,8 @@ memory_move_secondary_cost (enum machine_mode mode, enum reg_class rclass,
if (rclass == altclass)
/* This isn't simply a copy-to-temporary situation. Can't guess
- what it is, so MEMORY_MOVE_COST really ought not to be calling
- here in that case.
+ what it is, so TARGET_MEMORY_MOVE_COST really ought not to be
+ calling here in that case.
I'm tempted to put in an assert here, but returning this will
probably only give poor estimates, which is what we would've