From: Richard Biener <richard.guenther@gmail.com>
To: gcc@gcc.gnu.org,Paul Koning <paulkoning@comcast.net>,GCC
<gcc@gcc.gnu.org>
Subject: Re: How do I stop gcc from loading data into registers when that's not needed?
Date: Fri, 18 May 2018 18:07:00 -0000 [thread overview]
Message-ID: <DA4BF531-169A-4C8A-94F9-4A194CA85FEB@gmail.com> (raw)
In-Reply-To: <DEFF8EC9-5FC0-4CC5-9013-35814136CE0E@comcast.net>
On May 18, 2018 8:03:05 PM GMT+02:00, Paul Koning <paulkoning@comcast.net> wrote:
>Gents,
>
>In some targets, like pdp11 and vax, most instructions can reference
>data in memory directly.
>
>So when I have "if (x < y) ..." I would expect something like this:
>
> cmpw x, y
> bgeq 1f
> ...
>
>What I actually see, with -O2 and/or -Os, is:
>
> movw x, r0
> movw y, r1
> cmpw r0, r1
> bgeq 1f
> ...
>
>which is both longer and slower. I can't tell why this happens, or how
>to stop it. The machine description has "general_operand" so it
>doesn't seem to be the place that forces things into registers.
I would expect combine to merge the load and arithmetic and thus it is eventually the target costing that makes that not succeed.
Richard.
> paul
next prev parent reply other threads:[~2018-05-18 18:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 18:03 Paul Koning
2018-05-18 18:07 ` Richard Biener [this message]
[not found] ` <018C29D6-6245-4D31-B43B-623E080A6F87@comcast.net>
2018-05-22 8:49 ` Richard Biener
2018-05-22 19:26 ` Segher Boessenkool
2018-05-23 0:50 ` Paul Koning
2018-05-23 9:47 ` Richard Biener
2018-05-24 0:33 ` Paul Koning
2018-05-24 18:25 ` Segher Boessenkool
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=DA4BF531-169A-4C8A-94F9-4A194CA85FEB@gmail.com \
--to=richard.guenther@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=paulkoning@comcast.net \
/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).