From: Jeff Law <law@redhat.com>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>,
gcc Patches <gcc-patches@gcc.gnu.org>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [PATCH][combine][RFC] Don't transform sign and zero extends inside mults
Date: Mon, 02 Nov 2015 22:31:00 -0000 [thread overview]
Message-ID: <5637E426.1080805@redhat.com> (raw)
In-Reply-To: <56376FFF.3070008@arm.com>
On 11/02/2015 07:15 AM, Kyrill Tkachov wrote:
> Hi all,
>
> This patch attempts to restrict combine from transforming ZERO_EXTEND
> and SIGN_EXTEND operations into and-bitmask
> and weird SUBREG expressions when they appear inside MULT expressions.
> This is because a MULT rtx containing these
> extend operations is usually a well understood widening multiply operation.
> However, if the costs for simple zero or sign-extend moves happen to
> line up in a particular way,
> expand_compound_operation will end up mangling a perfectly innocent
> extend+mult+add rtx like:
> (set (reg/f:DI 393)
> (plus:DI (mult:DI (sign_extend:DI (reg/v:SI 425 [ selected ]))
> (sign_extend:DI (reg:SI 606)))
> (reg:DI 600)))
>
> into:
> (set (reg/f:DI 393)
> (plus:DI (mult:DI (and:DI (subreg:DI (reg:SI 606) 0)
> (const_int 202 [0xca]))
> (sign_extend:DI (reg/v:SI 425 [ selected ])))
> (reg:DI 600)))
Going to leave the review side of this for Segher.
If you decide to go forward, there's a section in md.texi WRT
canonicalization of these RTL codes that probably would need updating.
Just search for "canonicalization" section and read down a ways.
Jeff
next prev parent reply other threads:[~2015-11-02 22:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 14:15 Kyrill Tkachov
2015-11-02 22:31 ` Jeff Law [this message]
2015-11-04 11:37 ` Kyrill Tkachov
2015-11-04 13:33 ` Kyrill Tkachov
2015-11-04 23:50 ` Segher Boessenkool
2015-11-05 12:01 ` Kyrill Tkachov
2015-11-06 0:56 ` Segher Boessenkool
2015-11-06 14:19 ` Kyrill Tkachov
2015-11-06 21:14 ` Jeff Law
2015-11-06 22:00 ` Segher Boessenkool
2015-11-08 20:58 ` Segher Boessenkool
2015-11-09 7:52 ` Uros Bizjak
2015-11-09 9:51 ` Segher Boessenkool
2015-11-10 19:53 ` Segher Boessenkool
2015-11-13 10:10 ` Kyrill Tkachov
2015-11-13 10:17 ` Uros Bizjak
2015-11-13 15:01 ` 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=5637E426.1080805@redhat.com \
--to=law@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@arm.com \
--cc=segher@kernel.crashing.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).