public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/64700] Sink common code through PHI
Date: Wed, 21 Jan 2015 20:42:00 -0000	[thread overview]
Message-ID: <bug-64700-4-8L23AEQWoZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64700-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64700

--- Comment #2 from Jeffrey A. Law <law at redhat dot com> ---
I had a code hoisting pass on top of PRE a while back as well.  Can't remember
why I abandoned it.  Oh yea, on top of PRE :-)


I've still got a global code motion pass here based on Click's work.  It
handles both hoisting and sinking.  Basically you record the earliest possible
block for each statement and a latest block for each statement.  The path
through the dominator tree connecting those two blocks is the set of valid
blocks for the statement.

Then you just choose the 'best' one in that path.  Most control dependent path
within the shallowest loop nest.

It didn't handle sinking PHIs or hoisting/sinking through a dependent node. 
Not sure if it could be changed to do that.

I never pushed on it simply because it never did significantly better than the
other code motion code we already have.  It pointed out a few minor issues in
tree-ssa-sink.c, but nothing that couldn't be easily fixed.


Too bad, I always found the basic algorithm to be rather elegant.

I'm certain we're missing all kinds of interesting code motions..


  parent reply	other threads:[~2015-01-21 20:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 22:01 [Bug tree-optimization/64700] New: " law at redhat dot com
2015-01-21  9:43 ` [Bug tree-optimization/64700] " rguenth at gcc dot gnu.org
2015-01-21 20:42 ` law at redhat dot com [this message]
2021-07-20  2:52 ` pinskia at gcc dot gnu.org
2023-05-08  7:38 ` cvs-commit at gcc dot gnu.org
2023-05-08  7:40 ` pinskia at gcc dot gnu.org
2023-05-15  0:27 ` pinskia at gcc dot gnu.org

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=bug-64700-4-8L23AEQWoZ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).