This is the mail archive of the
mailing list for the GCC project.
Re: From SSA back to GIMPLE.
- From: skaller <skaller at users dot sourceforge dot net>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: "J.C. Pizarro" <jcpiza at gmail dot com>, "Jose ." <kasty dot jose at gmail dot com>, gcc at gcc dot gnu dot org, Diego Novillo <dnovillo at redhat dot com>
- Date: Tue, 23 Oct 2007 04:31:39 +1000
- Subject: Re: From SSA back to GIMPLE.
- References: <email@example.com> <471CB47B.firstname.lastname@example.org>
On Mon, 2007-10-22 at 16:32 +0200, Paolo Bonzini wrote:
> I don't know what you mean, but yes, there is value in going to SSA and
> back. SSA makes global optimization much easier, and that's the main
> improvement introduced in GCC 4.0 and later refined.
IMHO gcc was pretty crappy until 4.0. Now it generates good code.
SSA is a robust representation which allows strong assurances
that vagaries of the way the user wrote the source won't
interfere with generating good assembler.
Still .. the Felix generated version of Ackermann's function
outperforms the almost identical C code by almost 2:1 on
AMD64 .. I have no idea why, although I know what matters:
the number of words pushed onto the stack each recursion
is the only thing that actually affects performance.
Gcc pointlessly unrolls the recursion -- this has no effect
on the number of words pushed. It also makes a fairly serious
mistake, in that the recursion calls the externally visible
function, which is ABI compliant. It should generate a non-recursive
wrapper, and then use a recursive inner function which uses
an optimal but not necessarily ABI compliant interface.
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net