public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/64099] [5 Regression] ~15% runtime increase for fatigue.f90.
Date: Thu, 11 Dec 2014 15:02:00 -0000	[thread overview]
Message-ID: <bug-64099-4-zngUm7YQtu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64099-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
For r217826 vs. r217827 the assembly differences show a larger stack frame
while the optimized dump differences are net positive (more memory CSE happens
and loads get removed - which might increase register pressure enough).

For r216727 vs. r216728 the order of functions output changes, there are no
real changes in the optimized dumps.


Both rev. changes cause operand order to be swapped for some instructions
which can, given TER, result in significant scheduling differences in
the RTL expansion.


One thing is for example that the reassoc pass produces non-canonical
operand order but its operand order might be more optimal in practice
(the canonical order is just canonicalization for commutative operands).
As we deal with single-use chains there we might consider "swapping"
SSA names (swap SSA_NAME_VERSION) to preserve its ordering over a
fold_stmt call.  No, doing that doesn't make a significant difference :/
For reference:

Index: gcc/tree-ssa-reassoc.c
===================================================================
--- gcc/tree-ssa-reassoc.c      (revision 217827)
+++ gcc/tree-ssa-reassoc.c      (working copy)
@@ -3602,6 +3602,16 @@ rewrite_expr_tree (gimple stmt, unsigned
          update_stmt (stmt);
        }

+      if (commutative_tree_code (gimple_assign_rhs_code (stmt))
+         && tree_swap_operands_p (new_rhs1, oe->op, true))
+       {
+         gcc_assert (TREE_CODE (new_rhs1) == SSA_NAME
+                     && TREE_CODE (oe->op) == SSA_NAME);
+         std::swap (SSA_NAME_VERSION (new_rhs1), SSA_NAME_VERSION (oe->op));
+         std::swap (ssa_name (SSA_NAME_VERSION (new_rhs1)),
+                    ssa_name (SSA_NAME_VERSION (oe->op)));
+       }
+
       if (dump_file && (dump_flags & TDF_DETAILS))
        {
          fprintf (dump_file, " into ");


  parent reply	other threads:[~2014-12-11 15:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 10:47 [Bug middle-end/64099] New: " dominiq at lps dot ens.fr
2014-11-28 11:03 ` [Bug middle-end/64099] " rguenth at gcc dot gnu.org
2014-11-28 11:03 ` rguenth at gcc dot gnu.org
2014-11-28 13:16 ` rguenth at gcc dot gnu.org
2014-11-28 14:03 ` dominiq at lps dot ens.fr
2014-11-28 15:54 ` dominiq at lps dot ens.fr
2014-11-28 19:37 ` dominiq at lps dot ens.fr
2014-12-11 13:58 ` rguenth at gcc dot gnu.org
2014-12-11 15:02 ` rguenth at gcc dot gnu.org [this message]
2015-01-15 11:42 ` rguenth at gcc dot gnu.org
2015-01-15 12:32 ` dominiq at lps dot ens.fr
2015-03-03 16:02 ` law at redhat dot com
2015-04-15  9:47 ` [Bug middle-end/64099] [5/6 " dominiq at lps dot ens.fr
2015-04-15 11:24 ` dominiq at lps dot ens.fr
2015-04-15 13:15 ` dominiq at lps dot ens.fr
2015-04-22 12:02 ` jakub at gcc dot gnu.org
2015-07-16  9:20 ` rguenth at gcc dot gnu.org
2021-05-14  9:47 ` [Bug middle-end/64099] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2022-05-27  9:35 ` [Bug middle-end/64099] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:31 ` jakub at gcc dot gnu.org
2023-07-07 10:30 ` [Bug middle-end/64099] [11/12/13/14 " rguenth 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-64099-4-zngUm7YQtu@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).