This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[commit, spu] Fix MOVE_RATIO for the !speed case
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Jan 2011 20:07:17 +0100 (CET)
- Subject: [commit, spu] Fix MOVE_RATIO for the !speed case
Hello,
I'm seeing the following failure on SPU:
FAIL: gcc.dg/const-uniq-1.c scan-tree-dump-times gimple "L\\\$?C0" 2
It turns out that GCC was not using a template to copy the constructor
from, but rather initializing the array one-by-one, even though this
is much bigger code and we're optimizing for size.
This in turn was caused by the SPU back-end definition of MOVE_RATIO,
which has not been updated to take advantage of the distinction between
optimizing for speed vs. size; the value of 32 it uses may be OK when
optimizing for speed, but is much too high when optimizing for size.
The patch below changes this to a more reasonable value of 4 when
optimizing for speed.
Tested on spu-elf with no regression, fixes the above test.
Committed to mainline.
Bye,
Ulrich
ChangeLog:
* config/spu/spu.h (MOVE_RATIO): Return 4 in the !speed case.
Index: gcc/config/spu/spu.h
===================================================================
*** gcc/config/spu/spu.h (revision 168909)
--- gcc/config/spu/spu.h (working copy)
*************** targetm.resolve_overloaded_builtin = spu
*** 406,412 ****
#define SLOW_BYTE_ACCESS 0
! #define MOVE_RATIO(speed) 32
#define NO_FUNCTION_CSE
--- 406,412 ----
#define SLOW_BYTE_ACCESS 0
! #define MOVE_RATIO(speed) ((speed)? 32 : 4)
#define NO_FUNCTION_CSE
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com