This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
too much GCSE in ia64
- To: <gcc at gcc dot gnu dot org>
- Subject: too much GCSE in ia64
- From: Paolo Bonzini <bonzini at wbkst15 dot mach dot uni-karlsruhe dot de>
- Date: Tue, 16 Jan 2001 14:51:48 +0100 (CET)
While adding some caching mechanisms to GNU Smalltalk (refer to another
message the other day) in the hope to improve register usage on the ia64,
I stumbled into this problem.
My interpreter has many bytecodes like "push local variable #1", "push
local variable #2", and so on, which are open-coded and implemented like
*sp++ = tempCache[2];
inside a huge switch statement. Now, GCSE moved all the address
computations to *every* case block, generating some 60 completely useless
adds for every bytecode: that is 10 wasted clock cycles per bytecode on
the Itanium (instead of 6 clock cycles that GNU Smalltalk manages to
obtain with -fno-gcse). This is even more useless considering that there
is a lot of room for scheduling the effective address generation in the
basic block containing the statement above!
Actually, even plain wrong code was generated in another case (note that
-fno-sched-spec-dangerous did not help) active: in presence of cases like
*sp++ = selfCache->object->data[2]
GCC wanted to hoist the computation of &selfCache->object->data[2] too to
all the case blocks too. This is disastrous if selfCache happens not to
be valid.
GCSE seems to be quite overzealous to me, at least on this target.
Paolo Bonzini