From: Andrew Pinski <pinskia@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Jeff Law <law@redhat.com>, Richard Biener <richard.guenther@gmail.com>
Subject: Re: [RFA] Factor conversion out of COND_EXPR using match.pd pattern
Date: Mon, 29 Jun 2015 22:32:00 -0000 [thread overview]
Message-ID: <CA+=Sn1=f-taDUo755LD-EOLC4gTim+X=1jkEOQt4ZpGd3MebUw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1506300001220.18941@laptop-mg.saclay.inria.fr>
On Mon, Jun 29, 2015 at 3:12 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Mon, 29 Jun 2015, Jeff Law wrote:
>
>>> That said - for this kind of patterns testcases that exercise the
>>> patterns
>>> on GIMPLE would be very appreciated.
>>
>> It may be the case that these patterns don't make a lot of sense on gimple
>> and should be restricted to generic, at least with our current
>> infrastructure.
>>
>> The problem is when we lower from generic to gimple, we end up with
>> branchy code, not straight line code and there's no good way I see to write
>> a match.pd pattern which encompasses flow control.
>
>
> Andrew was working on a way to generate phiopt code automatically from
> match.pd patterns involving cond_expr, I don't know what the status is.
I stopped due to many different things. One was match.pd was too
immature for conditional expressions. The other reason was because I
had other things to do internally. I might pick up but it won't be
for another three months.
Thanks,
Andrew
>
>>>> or maybe use a for loop on comparisons, which would give names to
>>>> TREE_OPERAND (@0, *). This should even handle the operand_equal_p
>>>> alternative:
>>>>
>>>> (cond (cmp:c@0 @1 @2) (convert @1) INTEGER_CST@2)
>
>
> Hmm, looks like I wrote INTEGER_CST before the second occurence of @2
> instead of the first, so it is probably ignored :-(
>
>>> Yes, that would be my reference.
>>
>> But won't this require pointer equivalence? Are INTEGER_CST nodes fully
>> shared? What if @1 is something more complex than a _DECL node (remember,
>> we're working with GENERIC). So something like
>> (cond (cmp:c@0 @1 @2) (convert @3) INTEGER_CST@4))
>>
>> And using operand_equal_p seems more appropriate to me (and is still
>> better than the original (cond @0 ...) and grubbing around inside @0 to look
>> at operands.
>
>
> I don't understand this comment. When you write @1 twice, genmatch emits a
> call to operand_equal_p to check that they are "the same".
>
> --
> Marc Glisse
next prev parent reply other threads:[~2015-06-29 22:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-30 4:54 Jeff Law
2015-05-30 9:57 ` Bernhard Reutner-Fischer
2015-06-02 17:01 ` Jeff Law
2015-05-30 10:11 ` Marc Glisse
2015-06-01 10:55 ` Richard Biener
2015-06-02 17:35 ` Jeff Law
2015-06-29 17:58 ` Jeff Law
2015-06-29 22:22 ` Marc Glisse
2015-06-29 22:32 ` Andrew Pinski [this message]
2015-06-30 7:49 ` Richard Biener
2015-07-01 17:15 ` Jeff Law
2015-06-01 11:07 ` Richard Biener
2015-06-02 17:34 ` Jeff Law
2015-06-03 11:27 ` Richard Biener
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='CA+=Sn1=f-taDUo755LD-EOLC4gTim+X=1jkEOQt4ZpGd3MebUw@mail.gmail.com' \
--to=pinskia@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=richard.guenther@gmail.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).