summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-19 22:01:17 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-19 22:01:17 +0000
commite207fd7ae6bbf4146f40cc68e841a2576695d7ca (patch)
tree548133d8c92115bf18fa7c2d6f3e7800dbd456bb /gcc/gcse.c
parent3b19d3be1ae915879fa5f404b2cb88242058d980 (diff)
downloadgcc-e207fd7ae6bbf4146f40cc68e841a2576695d7ca.tar.gz
* gcse.c (want_to_gcse_p): On STACK_REGS targets, look through
constant pool references to identify stack mode constants. * rtlanal.c (constant_pool_constant_p): New predicate to check whether operand is a floating point constant in the pool. * rtl.h (constant_pool_constant_p): Prototype here. * loop.c (scan_loop): Avoid hoisting constants from the constant pool on STACK_REGS targets. (load_mems): Likewise. * loop-invariant.c (get_inv_cost): Make hoisting constant pool loads into x87 registers expensive in terms of register pressure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 93c366b7dbe..42707373779 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -1170,6 +1170,14 @@ static basic_block current_bb;
static int
want_to_gcse_p (rtx x)
{
+#ifdef STACK_REGS
+ /* On register stack architectures, don't GCSE constants from the
+ constant pool, as the benefits are often swamped by the overhead
+ of shuffling the register stack between basic blocks. */
+ if (IS_STACK_MODE (GET_MODE (x)))
+ x = avoid_constant_pool_reference (x);
+#endif
+
switch (GET_CODE (x))
{
case REG: