public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/102178] [12 Regression] SPECFP 2006 470.lbm regressions on AMD Zen CPUs after r12-897-gde56f95afaaa22
Date: Wed, 09 Feb 2022 15:51:11 +0000	[thread overview]
Message-ID: <bug-102178-4-BRVxAtWQVL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102178-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #28 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Could somebody benchmark the following patch on zen2 470.lbm.

diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index 9cee17479ba..76619aca8eb 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -5084,7 +5089,9 @@ lra_constraints (bool first_p)
                             (x, lra_get_allocno_class (i)) == NO_REGS))
                        || contains_symbol_ref_p (x))))
              ira_reg_equiv[i].defined_p = false;
-           if (contains_reg_p (x, false, true))
+           if (contains_reg_p (x, false, true)
+               || (CONST_DOUBLE_P (x)
+                   && maybe_ge (GET_MODE_SIZE (GET_MODE (x)), 8)))
              ira_reg_equiv[i].profitable_p = false;
            if (get_equiv (reg) != reg)
              bitmap_ior_into (equiv_insn_bitmap,
&lra_reg_info[i].insn_bitmap);

If it improves the performance, I'll commit this patch.

The expander unconditionally uses memory pool for double constants.  I think
the analogous treatment could be done for equiv double constants in LRA.

I know only x86_64 permits 64-bit constants as immediate for moving them into
general regs.  As double fp operations is not done in general regs in the most
cases, they should be moved into fp regs and this is costly as Jan wrote.  So
it has sense to prohibit using equiv double constant values in LRA
unconditionally.  If in the future we have a target which can move double
immediate into fp regs we can introduce some target hooks to deal with equiv
double constant.  But right now I think there is no need for the new hook.

  parent reply	other threads:[~2022-02-09 15:51 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 15:38 [Bug tree-optimization/102178] New: " jamborm at gcc dot gnu.org
2021-09-03  7:07 ` [Bug tree-optimization/102178] " marxin at gcc dot gnu.org
2021-09-06  6:40 ` rguenth at gcc dot gnu.org
2021-09-06  6:41 ` [Bug tree-optimization/102178] [12 Regression] " rguenth at gcc dot gnu.org
2021-09-07  2:46 ` luoxhu at gcc dot gnu.org
2021-09-08 14:06 ` jamborm at gcc dot gnu.org
2021-09-16 16:17 ` jamborm at gcc dot gnu.org
2022-01-20 10:20 ` rguenth at gcc dot gnu.org
2022-01-26 15:57 ` marxin at gcc dot gnu.org
2022-01-27  7:42 ` [Bug rtl-optimization/102178] " rguenth at gcc dot gnu.org
2022-01-27  7:55 ` rguenth at gcc dot gnu.org
2022-01-27  8:13 ` crazylht at gmail dot com
2022-01-27  8:18 ` crazylht at gmail dot com
2022-01-27  8:20 ` rguenth at gcc dot gnu.org
2022-01-27  9:34 ` rguenth at gcc dot gnu.org
2022-01-27  9:55   ` Jan Hubicka
2022-01-27  9:55 ` hubicka at kam dot mff.cuni.cz
2022-01-27 10:13 ` rguenth at gcc dot gnu.org
2022-01-27 10:14 ` rguenth at gcc dot gnu.org
2022-01-27 10:23 ` hubicka at kam dot mff.cuni.cz
2022-01-27 10:32 ` rguenth at gcc dot gnu.org
2022-01-27 11:18 ` rguenth at gcc dot gnu.org
2022-01-27 11:30 ` rguenther at suse dot de
2022-01-27 11:33 ` rguenther at suse dot de
2022-01-27 12:04   ` Jan Hubicka
2022-01-27 12:04 ` hubicka at kam dot mff.cuni.cz
2022-01-27 13:42 ` hjl.tools at gmail dot com
2022-01-27 14:24 ` rguenth at gcc dot gnu.org
2022-01-27 16:28 ` crazylht at gmail dot com
2022-01-27 16:36 ` crazylht at gmail dot com
2022-01-28 15:48 ` vmakarov at gcc dot gnu.org
2022-01-28 16:02 ` vmakarov at gcc dot gnu.org
2022-02-09 15:51 ` vmakarov at gcc dot gnu.org [this message]
2022-02-10  7:45 ` rguenth at gcc dot gnu.org
2022-02-10 15:17 ` vmakarov at gcc dot gnu.org
2022-04-11 13:04 ` rguenth at gcc dot gnu.org
2022-04-25  9:45 ` rguenth at gcc dot gnu.org
2022-04-25 12:52 ` rguenth at gcc dot gnu.org
2022-04-25 13:02 ` rguenth at gcc dot gnu.org
2022-04-25 13:09 ` rguenth at gcc dot gnu.org
2023-04-26  6:55 ` [Bug rtl-optimization/102178] [12/13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:22 ` rguenth at gcc dot gnu.org
2024-05-21  9:10 ` [Bug rtl-optimization/102178] [12/13/14/15 " jakub 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-102178-4-BRVxAtWQVL@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).