public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: "jim.wilson@linaro.org" <jim.wilson@linaro.org>,
	"Andrew.pinski@cavium.com" <Andrew.pinski@cavium.com>
Cc: nd <nd@arm.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, AArch64] Disable reg offset in quad-word store for Falkor.
Date: Fri, 22 Sep 2017 20:06:00 -0000	[thread overview]
Message-ID: <DB6PR0801MB20539CFE20F6C663C4C33AEB83670@DB6PR0801MB2053.eurprd08.prod.outlook.com> (raw)

Hi Jim,

This looks like a general issue with reg+reg addressing modes being generated in
cases where it is not correct. I haven't looked at lmbench for a while, but it generated
absolutely horrible code like:

add x1, x0, #120
ldr v0, [x2, x1]
add x1, x0, #128
ldr v1, [x2, x1]

If this is still happening, we need to fix this in a general way as this is bad for any
CPU even if reg+reg is fast. Reduced testcases for this would be welcome as it's
likely many other targets are affected. A while ago I posted a patch to reassociate
(x + C1) * C2 -> x * C2 + C3 to improve cases like this.

Note we already support adjusting addressing costs. There are several other CPUs
which increase the reg+reg costs. So that's where I would start - assuming reg+reg
addressing mode was correctly used.

Finally, if you really want to completely disable a particular addressing mode, it's
best done in classify_address rather than changing the md patterns. My experience
is that if you use anything other than the standard 'm' constraint, GCC reload starts
to generate inefficient code even if the pattern should still apply. I have posted
several patches to use 'm' more to get better spill code and efficient expansions
if the offset happens to be too large.

Wilco

             reply	other threads:[~2017-09-22 20:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 20:06 Wilco Dijkstra [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-22 15:49 Jim Wilson
2017-09-22 15:59 ` Jim Wilson
2017-09-22 17:59   ` Andrew Pinski
2017-09-22 18:39     ` Jim Wilson
2017-09-22 21:11       ` Andrew Pinski
2017-10-12 21:54         ` Jim Wilson
2017-10-31  3:40           ` Kugan Vivekanandarajah
2017-10-31 16:18             ` Jim Wilson
2017-11-01 22:59               ` Kugan Vivekanandarajah

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=DB6PR0801MB20539CFE20F6C663C4C33AEB83670@DB6PR0801MB2053.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=Andrew.pinski@cavium.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jim.wilson@linaro.org \
    --cc=nd@arm.com \
    /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).