public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: register allocation vs. scheduling and other stuff
@ 2003-01-07 20:41 Robert Dewar
  2003-01-07 23:04 ` tm
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Robert Dewar @ 2003-01-07 20:41 UTC (permalink / raw)
  To: dewar, tm_gccmail; +Cc: dberlin, gcc, lucier, tm

are you really sure that only 5000 Itanium machines shipped. I knew the
number was low, but I am surprised it was that low.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: register allocation vs. scheduling and other stuff
@ 2003-01-07 20:40 Robert Dewar
  0 siblings, 0 replies; 15+ messages in thread
From: Robert Dewar @ 2003-01-07 20:40 UTC (permalink / raw)
  To: dewar, tm_gccmail; +Cc: dberlin, gcc, lucier, tm

I assume that in your note Merced = Itanium, and McKinley = Itanium-2 (the
code words are long out of use at this stage). I really meant ia64, the
architecture, since regardless of the implementation, the scheduling and
register allocation issues are very much more important with these
implementations (all of them) of ia64.

A lot of useful material can be found at www.trimaran.org

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: register allocation vs. scheduling and other stuff
@ 2003-01-07 12:47 Robert Dewar
  2003-01-07 19:53 ` tm_gccmail
  0 siblings, 1 reply; 15+ messages in thread
From: Robert Dewar @ 2003-01-07 12:47 UTC (permalink / raw)
  To: dberlin, tm; +Cc: dewar, gcc, lucier

> They also aren't necessarily doing better than a good scheduler and 
> good allocator, in terms of runtime performance or compile time 
> performance.

I disagree for architectures like the ia64. Have a look at some of the
recent literature in this area.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: register allocation vs. scheduling and other stuff
@ 2003-01-07  3:42 Robert Dewar
  2003-01-07  5:08 ` tm
  0 siblings, 1 reply; 15+ messages in thread
From: Robert Dewar @ 2003-01-07  3:42 UTC (permalink / raw)
  To: lucier, tm; +Cc: gcc

> The point I was trying to make that got lost in all the verbiage is
> that one might want to try to teach the register allocator a bit
> about scheduling rather than trying to teach the scheduler a bit about
> register allocation.

At this point there are very good combined algorithms that are neither
of the above, but instead treat the allocation/scheduling problem as
a single problem with a unified solution.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: register allocation vs. scheduling and other stuff
@ 2003-01-06 23:52 tm
  2003-01-07  0:18 ` Brad Lucier
  0 siblings, 1 reply; 15+ messages in thread
From: tm @ 2003-01-06 23:52 UTC (permalink / raw)
  To: lucier; +Cc: gcc


Brad Lucier wrote:

>I've been playing around with -fnew-ra, -fno-trapping-math, and various
>schedule options for 3.4 on powerpc-darwin.
>
>For a molecular energy minization code, where an affine transformation
>is applied consecutively to the location of each atom in the molecule, 
>
>-O1 -fno-trapping-math -fschedule-insns2 -fnew-ra -mcpu=7400
>
>works very well, the code is a bunch of overlapped loads, stores,
>and floating-point operations, but
>
>-O1 -fno-trapping-math -fschedule-insns -fschedule-insns2 -fnew-ra
>-mcpu=7400
>
>which also schedules *before* register allocation is 50% slower, since
>the schedule pass before hard register allocation loads *all* the x-y-z
>information for all the atoms into pseudo-registers at the top of the
>routine,
>and requires many moves between the stack and registers when these values
>are actually needed for computations.

Actually, I've seen it much worse than this.

The PowerPC has 32 registers. The SH only has 16 registers, and
when the first instruction scheduling was enabled, the code could
run over 3x slower in extreme cases. I would see assembly listings where
about 80% of the page was spent thrashing registers to/from the stack.

>Perhaps, since -fno-trapping-math is a relatively new option, this is
>a recent concern.
>
>I've heard people on these lists talk about making scheduling smarter, so
>it knows something about register pressure.  It seems that the general
>solution would be to do register allocation and scheduling together.

It may be possible to have something simpler. In many cases where I've
seen this problem, it's because the scheduler has hoisted multiple loads
up too high which starves the register allocator. If the register
lifetimes could be shortened by moving down the loads, much of the problem
would be solved.

>Since we will have a new register allocator for 3.4 that is based on
>graph coloring, perhaps one could add a new flag
>
>--fuse-all-registers
>
>that would not try to use the *minimum* number of colors to color an
>interference graph, but, if the minimum number is less than the actual
>number of available registers, it could use the actual numbers of
>registers to color the graph, perhaps guided by liveness information.

This is a kludgy solution IMHO.

1. If you have multiple functions in a source file, then you wind up
applying this option to all the functions in that file, and to have
function-level granularity you would need to split the file.

2. This doesn't permit basic-block level control of the optimization.

3. Most compiler end-users don't understand the concept of machine
registers much less "high register pressure". In order to be really
effective, it needs to be enabled automagically when needed without user
intervention.

Toshi

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-01-07 23:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 20:41 register allocation vs. scheduling and other stuff Robert Dewar
2003-01-07 23:04 ` tm
2003-01-07 23:18 ` Florian Weimer
2003-01-08  0:32   ` tm_gccmail
2003-01-07 23:26 ` tm
2003-01-08  0:34   ` Mike Stump
  -- strict thread matches above, loose matches on Subject: below --
2003-01-07 20:40 Robert Dewar
2003-01-07 12:47 Robert Dewar
2003-01-07 19:53 ` tm_gccmail
2003-01-07  3:42 Robert Dewar
2003-01-07  5:08 ` tm
2003-01-07  6:53   ` Daniel Berlin
2003-01-06 23:52 tm
2003-01-07  0:18 ` Brad Lucier
2003-01-07  1:27   ` tm_gccmail

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).