public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/79201] missed optimization: sinking doesn't handle calls, swap PRE and sinking
Date: Sat, 11 Sep 2021 07:04:24 +0000	[thread overview]
Message-ID: <bug-79201-4-54EkXDVMTS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-79201-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
           Severity|normal                      |enhancement
         Resolution|FIXED                       |---

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So this is actually still broken in the sense if we turn off dominator
optimizations (-fno-tree-dominator-opts), the problem with PRE and sink
interaction comes into play still.

The improvement came in via r8-2694 which in fact added
-fno-tree-dominator-opts to gcc.dg/tree-ssa/ssa-sink-16.c .
Note DOM actually does the sinking rather than the rotating of the loop.

here is a testcase where DOM does not mess with the loop but we should still be
able to sink the function out and do when adding  -fno-tree-pre:

int f(int n, int t) {
  int i,j=0;
  if (t >=31 || t < 0)  return 100;

  for (i = 0; i < t; i++) {
    j = __builtin_ffs(i);
  }
  return j;
}

  parent reply	other threads:[~2021-09-11  7:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-79201-4@http.gcc.gnu.org/bugzilla/>
2021-06-11 10:12 ` drraph at gmail dot com
2021-09-11  7:04 ` pinskia at gcc dot gnu.org [this message]
2024-06-06 10:59 ` drraph at gmail dot com
2024-06-06 11:08 ` 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-79201-4-54EkXDVMTS@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).