diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-11-02 09:34:54 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-11-02 09:34:54 +0000 |
commit | b6ea32c35a3144f01e2d1f78ba24925196bc97a7 (patch) | |
tree | 417cb41087b6a363102c51ebf7a4358bd360b492 /gcc/reload.c | |
parent | df41fe2ee93d13e2e6f7f9eb5565417636525297 (diff) | |
download | gcc-b6ea32c35a3144f01e2d1f78ba24925196bc97a7.tar.gz |
* Makefile.in (targhooks.o, reload.o): Update dependencies.
(GTFILES): Add targhooks.c.
(gt-targhooks.h): New rule; depend on s-gtype.
* target.h (direct_pool_load_p): New hook.
* target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro.
(TARGET_INITIALIZER): Include it.
* targhooks.h (default_direct_pool_load_p): Declare.
(hook_bool_machine_mode_true): Declare.
* targhooks.c: Include insn-config.h, recog.h, ggc.h and
gt-targhooks.h.
(pool_symbol): New variable.
(default_direct_pool_load_p): New function.
(hook_bool_machine_mode_true): New function.
* reload.c: Include target.h.
(find_reloads): If an alternative will force a constant into memory,
count an extra reload if constant pool symbols are not valid
addresses. If an alternative uses memory to move values between
registers, count the move as two reloads rather than one.
* config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define.
* doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73196 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 8bd68c51bf5..13dd25ed061 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -104,6 +104,7 @@ a register with any other reload. */ #include "output.h" #include "function.h" #include "toplev.h" +#include "target.h" #ifndef REGNO_MODE_OK_FOR_BASE_P #define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) REGNO_OK_FOR_BASE_P (REGNO) @@ -3369,6 +3370,11 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, const_to_mem = 1; if (this_alternative[i] != (int) NO_REGS) losers++; + + /* If constant pool symbols are not valid addresses, + count an extra reload for the address. */ + if (!targetm.direct_pool_load_p (operand_mode[i])) + losers++; } /* If we can't reload this value at all, reject this @@ -3394,6 +3400,21 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, && ! const_to_mem) bad = 1; +#ifdef SECONDARY_MEMORY_NEEDED + /* If this alternative would use memory to move a value + between registers, it would need two reloads, one for + the load and one for the store. Account for the extra + reload here. */ + if (GET_CODE (operand) == REG + && REGNO (operand) < FIRST_PSEUDO_REGISTER + && this_alternative[i] != NO_REGS + && (SECONDARY_MEMORY_NEEDED + (this_alternative[i], + REGNO_REG_CLASS (REGNO (operand)), + GET_MODE (operand)))) + losers++; +#endif + /* We prefer to reload pseudos over reloading other things, since such reloads may be able to be eliminated later. If we are reloading a SCRATCH, we won't be generating any |