This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improvements to popping x87 stack in reg-stack.c


On Sat, 27 Nov 2004, Laurent GUERBY wrote:
> Just curious, do you have Whetstone results before and after your
> change?

I've just run some timings and I'll admit that I'm disappointed.  The
improvements to Whetstone are bearly measurable; the means and medians
of three runs are higher, but within the noise.

The problem is that microbenchmarks (or a GCC bootstrap :) just don't
expose the inefficiencies of reg-stack's x87 stack popping.  There are
barely a handful of basic blocks in whetstone that use floating point
registers, and at most these have one or two live values at the end of
each loop iteration.  It was only by examining much more complex floating
point codes such as tramp3d (or SPECfp) that I noticed/realized that it
was relatively easy to improve GCC's x87 stack popping.

Perhaps someone can show more significant gains on real-world
application?  AMD athlons should show more benefit than Intel P4s.


Unfortunately, the major problem with reg-stack is not change_stack,
but how we allocate decide/assign register stack positions to each
basic block.  GCC still chooses poor permutations for the source and
destination basic blocks, but we now generate faster and smaller
compenstation code on the edges between them.  Poor x87 stack allocation
remains one of the major contributions to GCC's lag behind Intel's
compiler on the FP loops of Whetstone.  A good example is that we
should attempt to minimize compensation code on the backedges of loops,
by choosing permutations that require adjustment on loop entry/exit
instead (PR rtl/15422).   Something for 4.1.

However, this patch is an important step forward as having efficient
code to rearrange the stack and an accurate measure of that cost are
critical components of better/optimal stack order allocation.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]