This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GVN-PRE sucks -- well, for SPECCFP2000 mgrid anyway
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 15 Aug 2004 10:01:54 -0400
- Subject: Re: GVN-PRE sucks -- well, for SPECCFP2000 mgrid anyway
- References: <200408151321.07846.stevenb@suse.de>
On Aug 15, 2004, at 7:21 AM, Steven Bosscher wrote:
Hi,
SPEC2000's mgrid benchmark has typical code fortran that looks
like this:
...
When gfortran flattens the arrays it exposes a lot of redundancies
for address arithmetic, most of which is loop invariant. So PRE
gets to work, moves everything it can out of the loop, and we get:
...
Ha. GCC overoptimized something.
Needless to say that on almost any architecture this will cause so
much spilling that PRE severely pessimizes the generated code. And
indeed, on AMD64, mgrid compiled with -fno-tree-pre is almost twice
as fast as mgrid with PRE enabled.
I guess this is convincing evidence that we need to teach tree PRE
about register pressure, just like tree loop invariant code motion.
Yeah.
I'll see if i can come up with some simple heuristics that help here,
without hurting anything else too much.