From f5c21ef3733d6a56ee3407ba8768abe551667f67 Mon Sep 17 00:00:00 2001 From: Anatoly Sokolov Date: Sat, 5 Jun 2010 21:27:51 +0400 Subject: target.h (struct gcc_target): Add memory_move_cost field. * 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. From-SVN: r160323 --- gcc/ira.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gcc/ira.c') diff --git a/gcc/ira.c b/gcc/ira.c index 4fac13c..843095d 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -358,9 +358,10 @@ HARD_REG_SET eliminable_regset; of given mode starting with given hard register. */ HARD_REG_SET ira_reg_mode_hard_regset[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]; -/* The following two variables are array analogs of the macros - MEMORY_MOVE_COST and REGISTER_MOVE_COST. */ +/* Array analogous to target hook TARGET_MEMORY_MOVE_COST. */ short int ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2]; + +/* Array analogous to macro REGISTER_MOVE_COST. */ move_table *ira_register_move_cost[MAX_MACHINE_MODE]; /* Similar to may_move_in_cost but it is calculated in IRA instead of @@ -527,11 +528,11 @@ setup_class_subset_and_memory_move_costs (void) for (mode = 0; mode < MAX_MACHINE_MODE; mode++) { ira_memory_move_cost[mode][cl][0] = - MEMORY_MOVE_COST ((enum machine_mode) mode, - (enum reg_class) cl, 0); + memory_move_cost ((enum machine_mode) mode, + (enum reg_class) cl, false); ira_memory_move_cost[mode][cl][1] = - MEMORY_MOVE_COST ((enum machine_mode) mode, - (enum reg_class) cl, 1); + memory_move_cost ((enum machine_mode) mode, + (enum reg_class) cl, true); /* Costs for NO_REGS are used in cost calculation on the 1st pass when the preferred register classes are not known yet. In this case we take the best scenario. */ -- cgit v1.1