From: James Greenhalgh <james.greenhalgh@arm.com>
To: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
Marcus Shawcroft <marcus.shawcroft@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH][AArch64] PR target/69161: Don't use special predicate for CCmode comparisons in expressions that require matching modes
Date: Thu, 04 Feb 2016 13:49:00 -0000 [thread overview]
Message-ID: <20160204134905.GA24322@arm.com> (raw)
In-Reply-To: <56AB76D6.5020104@foss.arm.com>
On Fri, Jan 29, 2016 at 02:27:34PM +0000, Kyrill Tkachov wrote:
> Hi all,
>
> In this PR we ICE during combine when trying to propagate a comparison into a vec_duplicate,
> that is we end up creating the rtx:
> (vec_duplicate:V4SI (eq:CC_NZ (reg:CC_NZ 66 cc)
> (const_int 0 [0])))
>
> The documentation for vec_duplicate says:
> "The output vector mode must have the same submodes as the input vector mode or the scalar modes"
> So this is invalid RTL, which triggers an assert in simplify-rtx to that effect.
>
> It has been suggested on the PR that this is because we use a special_predicate for
> aarch64_comparison_operator which means that it ignores the mode when matching.
> This is fine when used in RTXes that don't need it, like if_then_else expressions
> but can cause trouble when used in places where the modes do matter, like in
> SET operations. In this particular ICE the cause was the conditional store
> patterns that could end up matching an intermediate rtx during combine of
> (set (reg:SI) (eq:CC_NZ x y)).
>
> The suggested solution is to define a separate predicate with the same
> conditions as aarch64_comparison_operator but make it not special, so it gets
> automatic mode checks to prevent such a situation.
>
> This patch does that.
> Bootstrapped and tested on aarch64-linux-gnu.
> SPEC2006 codegen did not change with this patch, so there shouldn't be
> any code quality regressions.
>
> Ok for trunk?
It would be good to leave a more detailed comment on
"aarch64_comparison_operator_mode" as to why we need it.
Otherwise, this is OK.
Thanks,
James
>
> Thanks,
> Kyrill
>
> 2016-01-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> PR target/69161
> * config/aarch64/predicates.md (aarch64_comparison_operator_mode):
> New predicate.
> (aarch64_comparison_operator): Break overly long line into two.
> (aarch64_comparison_operation): Likewise.
> * config/aarch64/aarch64.md (cstorecc4): Use
> aarch64_comparison_operator_mode instead of
> aarch64_comparison_operator.
> (cstore<mode>4): Likewise.
> (aarch64_cstore<mode>): Likewise.
> (*cstoresi_insn_uxtw): Likewise.
> (cstore<mode>_neg): Likewise.
> (*cstoresi_neg_uxtw): Likewise.
>
> 2016-01-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> PR target/69161
> * gcc.c-torture/compile/pr69161.c: New test.
next prev parent reply other threads:[~2016-02-04 13:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 14:27 Kyrill Tkachov
2016-02-04 13:49 ` James Greenhalgh [this message]
2016-02-08 12:25 ` Kyrill Tkachov
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=20160204134905.GA24322@arm.com \
--to=james.greenhalgh@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@foss.arm.com \
--cc=marcus.shawcroft@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).