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 target/94298] x86 duplicates loads
Date: Mon, 30 Mar 2020 14:42:03 +0000	[thread overview]
Message-ID: <bug-94298-4-2etvOead23@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94298-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
I think that the root of the problem is that IRA on register cost calculation
sub-pass chooses memory for the pseudo.

It happens because the current algorithm (which is just an adoption of old
recglass.c) considers insn alternatives for each operand independently of other
operands. Roughly speaking, if we have insn with 2 alternatives and constraints
'r,m' for one operand and 'm,r' for another operand, the algorithm considers
'm' for the both operands (or 'r' for the both operands) are perfect (zero
cost) match.

I've tried to modify the current algorithm by small changes without a success. 
The full changes would result in what I have on ira-select branch.  ira-select
chooses an insn alternative and then calculate the costs taking this choice
into account.  Although move insns are a real challenge for such algorithm
because they have too many alternatives.

Switching to ira-select branch creates a lot of new testsuite failures on some
targets for GCC tests expecting a specific code generation and actually does
not improve overall SPEC rates on x86-64.

I am thinking about combination of the two approaches but it is definitely not
work which could be done for GCC10.

      parent reply	other threads:[~2020-03-30 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 10:17 [Bug target/94298] New: " rguenth at gcc dot gnu.org
2020-03-24 13:15 ` [Bug target/94298] " ubizjak at gmail dot com
2020-03-24 13:43 ` rguenther at suse dot de
2020-03-24 13:53 ` ubizjak at gmail dot com
2020-03-24 14:05 ` rguenther at suse dot de
2020-03-30 14:42 ` vmakarov at gcc dot gnu.org [this message]

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-94298-4-2etvOead23@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).