From 3d8504ac3262976d2c63d547a07aef0874f530b6 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Sun, 19 Feb 2006 22:01:17 +0000 Subject: gcse.c (want_to_gcse_p): On STACK_REGS targets... * 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. Co-Authored-By: Steven Bosscher From-SVN: r111283 --- gcc/loop.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/loop.c') diff --git a/gcc/loop.c b/gcc/loop.c index 1beb4dc..dc9d3a03 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -1222,6 +1222,12 @@ scan_loop (struct loop *loop, int flags) if (GET_MODE_CLASS (GET_MODE (SET_DEST (set))) == MODE_CC && CONSTANT_P (src)) ; +#ifdef STACK_REGS + /* Don't hoist constant pool constants into stack regs. */ + else if (IS_STACK_MODE (GET_MODE (SET_SRC (set))) + && constant_pool_constant_p (SET_SRC (set))) + ; +#endif /* Don't try to optimize a register that was made by loop-optimization for an inner loop. We don't know its life-span, so we can't compute @@ -10823,6 +10829,13 @@ load_mems (const struct loop *loop) && SCALAR_FLOAT_MODE_P (GET_MODE (mem))) loop_info->mems[i].optimize = 0; +#ifdef STACK_REGS + /* Don't hoist constant pool constants into stack registers. */ + if (IS_STACK_MODE (GET_MODE (mem)) + && constant_pool_constant_p (mem)) + loop_info->mems[i].optimize = 0; +#endif + /* If this MEM is written to, we must be sure that there are no reads from another MEM that aliases this one. */ if (loop_info->mems[i].optimize && written) -- cgit v1.1