public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
To: egcs@cygnus.com
Subject: Re: Reload patch to improve 386 code
Date: Tue, 19 Aug 1997 08:08:21 -0000	[thread overview]
Message-ID: <199708190621.IAA04731@haegar.physiol.med.tu-muenchen.de> (raw)
Message-ID: <19970819080821.S1vj85E23h4XVB_8oZ-M_HFWyV5ba-M9yv10QdkxNmU@z> (raw)
In-Reply-To: 199708181855.OAA03711@jenolan.rutgers.edu

> Before this leaves my head, I wanted to point something out which
> you've reminded me of.  When the scheduler (this applies to both the
> original and Haifa versions equally) becomes aggressive, it produces a
> large number of reloads in certain situations.  

The idea of running sched before reload seems to be to improve code like this:
move mem1 => pseudo1
move pseudo1 => mem2
move mem3 => pseudo2
move pseudo2 => mem4
move mem5 => pseudo3
move pseudo3 => mem6

If this is left as it stands, register allocation will most likely allocate
the pseudo to the same hard register. This means the post-reload sched pass
can't do anything with it, and the CPU can't either because there is no
parallelism in the code (well, at least the Pentium can't).

If sched modifies the above to look like this

move mem1 => pseudo1
move mem3 => pseudo2
move mem5 => pseudo3
move pseudo1 => mem2
move pseudo2 => mem4
move pseudo3 => mem6

you suddenly have two blocks of three independent instructions which could
run in parallel. However, this will lose badly once you don't have three
instructions of that kind, but a hundred (since your average CPU doesn't
have a hundred hard registers).

Another approach I've been thinking about is to add code that analyzes code
like this after reload

move mem1 => hardreg1
move hardreg1 => mem2
move mem3 => hardreg1
move hardreg1 => mem4
move mem5 => hardreg1
move hardreg1 => mem6

and tries to make it use as many independent hard registers as possible.
That would make the scheduling opportunities available without the risk
of over-scheduling before reload. I don't know how feasible this is.

Bernd

             reply	other threads:[~1997-08-19  8:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-19  7:36 Robert Wilhelm [this message]
1997-08-19  8:08 ` Bernd Schmidt
1997-08-19  8:08 ` Testsuite stuff Jeffrey A Law
1997-08-19  8:08 ` Reload patch to improve 386 code Jeffrey A Law
1997-08-19  8:08 ` Bernd Schmidt
1997-08-19  9:34 ` Some Haifa scheduler bugs Bernd Schmidt
  -- strict thread matches above, loose matches on Subject: below --
1997-08-19 17:54 Jeffrey A Law
1997-08-19 17:54 ` egcs: A new compiler project to merge the existing GCC forks (fwd) Dave Love
1997-08-19 17:18 Joern Rennecke
1997-08-19 13:19 H.J. Lu
1997-08-19  8:50 Reload patch to improve 386 code Jakub Jelinek
1997-08-19  9:47 ` egcs: A new compiler project to merge the existing GCC forks (fwd) Dave Love
1997-08-19  3:52 H.J. Lu
1997-08-19  4:27 ` Jeffrey A Law
1997-08-19  5:08 ` Oleg Krivosheev
1997-08-19  6:01 ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199708190621.IAA04731@haegar.physiol.med.tu-muenchen.de \
    --to=crux@pool.informatik.rwth-aachen.de \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).