This is the mail archive of the
mailing list for the GCC project.
RE: Short Displacement Problems.
- From: "Naveen Sharma, Noida" <naveens at noida dot hcltech dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: law at redhat dot com, Alexandre Oliva <aoliva at redhat dot com>, bernds at redhat dot com, gniibe at m17n dot org, Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 30 May 2002 13:09:19 +0530
- Subject: RE: Short Displacement Problems.
> > An obvious problem ( as I mentioned in my previous mail)
> > I could see is that most of stack allocations are called
> from reload.
> > While stack offset assignments would be most beneficial
> before register
> > allocation, the picture of the stack isn't clear untill reload.
> > I want that register allocation should benefit from offset
> > If I do stack offset assignment after register allocation,
> > I might get reduction in code size but that would be not be as good
> > as it won't reduce register pressure during register
> > Thoughts and ideas ??
> In general, the most important subproblem is to find the best
> stack slots for
> register spills. -O2 is notoriously bad at this, because the
> registers that
> are spilled last get the largest offsets. -O2
> -fomit-frame-pointer, OTOH,
> gives the last stilled registers the smallest offset.
> If you want to get any better than that, your optimization
> has to run inside
> of or alongside to or instead of reload.
One problem with this strategy is that
reshuffling stack during reload is expensive because
1. There would be lot of stack variable references that we will have to
fix up in insn chain while allocating "each" stack slot.
The entire logic will increase compilation time.
e.g consider this scenario, we have some "n" number of variables on stack.
relaod phase calls assign_stack_local for some pseudo, and from access
data of that pseudo, we decide to put it somewhere between 1 .. n
at positon "i".The offsets of i+1 .. n variables are effected and
all references to them fixed up.
But it seems there might be a tradeoff involved here.Let me see
how people view this problem.
Would the performance increase justify increase in