public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: "Martin Liška" <mliska@suse.cz>,
	"Richard Biener" <richard.guenther@gmail.com>
Cc: David Malcolm <dmalcolm@redhat.com>,
	Jakub Jelinek <jakub@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Jan Hubicka <hubicka@ucw.cz>, Aldy Hernandez <aldyh@redhat.com>
Subject: Re: [PATCH] Add if-chain to switch conversion pass.
Date: Tue, 6 Oct 2020 09:23:46 -0400	[thread overview]
Message-ID: <1c3b7e9c-2385-dcd3-7a1d-ebeef6877939@redhat.com> (raw)
In-Reply-To: <508d69a1-912b-10a9-aee5-8f795dd4034e@suse.cz>

On 10/6/20 9:09 AM, Martin Liška wrote:
> On 10/6/20 2:56 PM, Andrew MacLeod wrote:
>> Ah, by just using the outgoing_range class, all you are getting is 
>> static edges.  so a TRUE edge is always a [1,1] and a false edge is [0,0]
>> I provided that class so you could get the constant edges on switches.
>>
>> if you want to get actual ranges for ssa-names, you will need the 
>> ranger (which I think is going in today).  It uses those values as 
>> the starting point for winding back to calculate other dependent names.
>
> Ah, all right!
>
>>
>> Then  you will want to query the ranger for the range of index_5 on 
>> that edge..
>
> Fine! So the only tricky thing here is to select a proper SSA_NAME to 
> query right?
> In my case I need to cover situations like:
>
>   index.0_1 = (unsigned int) index_5(D);
>   _2 = index.0_1 + 4294967287;
>   if (_2 <= 114)
>
> or
>
>     _1 = aChar_8(D) == 1;
>     _2 = aChar_8(D) == 10;
>     _3 = _1 | _2;
>     if (_3 != 0)
>
> Anything Ranger can help me with?
>
> Martin
>

Well, it *does* assume you know the name of what you are looking for :-P


however, lets see.  it does know the names of things it can generate 
ranges for.     We havent gotten around to adding an API for querying 
that.  but that would be possible.

It maintains an export list of names it can calculate ranges for (as a 
bitmap). so for your 2 examples,  the export list of the first block 
contains
    _2, index.0_1, and index_5
and in the second case, it would contain
_3, _2, _1, and aChar_8

So even if you had access to the export list, you'd still have to figure 
out which one you wanted so I'm not sure that helps.  But i suppose you 
could go thru the list looking for something interesting.

I have longer term plans to expose/determine the "control names" which 
trigger the branch, and would be  '_2' in the first example and 
'aChar_8' in the second... but that facility is not built yet.



>>
>> so you will need a gimple ranger instance instead of an 
>> outgoing_range object.
>>
>> Andrew
>


  reply	other threads:[~2020-10-06 13:23 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 14:23 Martin Liška
2019-11-04 14:49 ` Jakub Jelinek
2019-11-05 12:38   ` Richard Biener
2019-11-06 21:03     ` Bernhard Reutner-Fischer
2019-11-14  9:44       ` Martin Liška
2019-11-14 12:35         ` Bernhard Reutner-Fischer
2019-11-14  9:41     ` Martin Liška
2019-11-14 10:48       ` Richard Biener
2019-11-15 13:56         ` Martin Liška
2020-09-01 11:47           ` Martin Liška
2020-09-01 14:50             ` David Malcolm
2020-09-02 11:53               ` Martin Liška
2020-09-21  8:55                 ` Martin Liška
2020-09-24 12:41                 ` Richard Biener
2020-09-25 14:05                   ` Martin Liška
2020-09-29  8:46                     ` Richard Biener
2020-10-02 13:26                       ` Martin Liška
2020-10-02 14:19                         ` Andrew MacLeod
2020-10-06 12:09                           ` Martin Liška
2020-10-06 12:56                             ` Andrew MacLeod
2020-10-06 13:09                               ` Martin Liška
2020-10-06 13:23                                 ` Andrew MacLeod [this message]
2020-10-06 13:41                                 ` Richard Biener
2020-10-02 13:23                   ` Martin Liška
2020-10-06  7:47                     ` Richard Biener
2020-10-06 13:48                       ` Martin Liška
2020-10-06 14:12                         ` Jakub Jelinek
2020-10-12 12:39                           ` Martin Liška
2020-10-12 13:00                             ` Jakub Jelinek
2020-10-14 18:09                             ` Andrew MacLeod
2020-10-07  8:00                         ` Richard Biener
2020-10-12 12:44                           ` Martin Liška
2020-10-12 13:01                             ` Martin Liška
2020-10-15 12:38                               ` Richard Biener
2020-10-16 14:04                             ` [PATCH v2] " Martin Liška
2020-11-06 12:31                               ` Richard Biener
2020-11-09 12:26                                 ` Martin Liška
2020-11-16 12:21                                   ` Richard Biener
2020-11-18 12:25                                     ` Martin Liška
2020-11-19 14:46                                       ` Richard Biener
2020-11-20  8:57                                         ` Martin Liška
2020-11-20 14:37                                           ` Richard Biener
2020-11-27 15:07                                             ` Martin Liška
2020-12-01 10:34                                               ` Richard Biener
2020-12-01 13:57                                                 ` [PATCH] if-to-switch: Support chain with 2 BBs Martin Liška
2020-12-01 22:14                                                   ` Jeff Law
2019-11-13 11:32   ` [PATCH] Add if-chain to switch conversion pass Martin Liška
2019-11-13 16:14     ` Michael Matz
2019-11-14 10:07       ` Martin Liška

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=1c3b7e9c-2385-dcd3-7a1d-ebeef6877939@redhat.com \
    --to=amacleod@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jakub@redhat.com \
    --cc=mliska@suse.cz \
    --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).