This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][combine][RFC][2/2] PR rtl-optimization/68796: Perfer zero_extract comparison against zero rather than unsupported shorter modes
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Dec 2015 11:27:32 -0600
- Subject: Re: [PATCH][combine][RFC][2/2] PR rtl-optimization/68796: Perfer zero_extract comparison against zero rather than unsupported shorter modes
- Authentication-results: sourceware.org; auth=none
- References: <5672D68F dot 3030408 at foss dot arm dot com> <5672DB97 dot 7090800 at redhat dot com> <5672DE74 dot 7080802 at foss dot arm dot com> <5672DEE0 dot 8000509 at redhat dot com>
On Thu, Dec 17, 2015 at 05:12:16PM +0100, Bernd Schmidt wrote:
> On 12/17/2015 05:10 PM, Kyrill Tkachov wrote:
> >Well, this patch still produces the QImode comparison if the target has
> >a QImode comparison
> >(the have_insn_for check in the simplify_comparison hunk).
>
> Ok, I didn't look that closely because I had doubts about the approach.
> This kind of check also goes somewhat against the principles of just
> producing canonical forms of RTL.
The canonicalisation rules exist so that optimisers only need to match
one form instead of several, and machine descriptions only need to
describe one form instead of several. For this bitmasking case it
perversely forces you to describe the same instruction in many ways,
for many targets. This is what the change_zero_ext was about as well.
It's not so easy to fix for the compare case. Maybe the idea of making
genrecog make code that recognises more forms of the same insn will work
out. GCC 7 in any case...
Segher