public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Andrew MacLeod <amacleod@redhat.com>,
	Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Aldy Hernandez <aldyh@redhat.com>
Subject: Re: [PATCH] Loop unswitching: support gswitch statements.
Date: Thu, 9 Dec 2021 13:59:35 +0100	[thread overview]
Message-ID: <229e3b6e-74f8-e538-db6d-1ce1d3302bff@suse.cz> (raw)
In-Reply-To: <9cf19620-befb-314f-07a3-d18c3e613dcb@redhat.com>

On 12/3/21 15:09, Andrew MacLeod wrote:
> On 12/2/21 11:02, Martin Liška wrote:
>> On 12/2/21 15:27, Andrew MacLeod wrote:
>>> ranger->gori().outgoing_edge_range_p (irange &r, edge e, tree name, *get_global_range_query ());
>>
>> Thank you! It works for me!
>>
>> Martin
>>
> btw, this applies to names not  on the stmt as well.   The function returns TRUE if there is an outgoing range calculable, and false if not.  so:
> 
> a = b + 20
> if (a > 40)        <- returns TRUE for outgoing range of 'a' or 'b'
>      {
>         c = foo()
>         if (c > 60)   <- returns false for 'a' or 'b'
>             {
>                 if (b < 100)   <- Also returns TRUE for 'a' or 'b'

Hello.

That's quite interesting support. However, for the bug mentioned earlier in this email conversion,
I only want local range for a gcond/gswitch, ignoring all path leading to the statement.

Martin

> 
> The final block, from the EVRP dump:
> 
>      <bb 4> :
>      if (b_4(D) <= 99)
>        goto <bb 5>; [INV]
>      else
>        goto <bb 6>; [INV]
> 
> 4->5  (T) b_4(D) :      unsigned int [21, 99]
> 4->5  (T) a_5 :         unsigned int [41, 119]
> 4->6  (F) b_4(D) :      unsigned int [100, 4294967275]
> 4->6  (F) a_5 :         unsigned int [120, +INF]
> 
> Shows that it has a range for both 'a' and 'b'.
> 
> Just to point out that you can use this query on any conditional edge, even if it isnt directly mentioned on the stmt.  so if you are keying of 'a', you could simply ask if outgoing_edge_range_p ( , a,...)  rather than parsing the condition to see if 'a' is on it.   if there is no chance that 'a' is affected by the block, is just returns false.
> 
> When its called directly like this, it picks up no ranges from outside the basic block you are querying, except via that range query you provide. The listing shows the defaultwhic is whatever ranger knows. So if you provided get_global_range_query, those ranges would instead be something like:
> 
> 4->5  (T) b_4(D) :      unsigned int [0, 99]
> 4->5  (T) a_5 :         unsigned int [21, 119]
> 4->6  (F) b_4(D) :      unsigned int [100, +INF]
> 4->6  (F) a_5 :         unsigned int [0,20] [120, +INF-20 ]
> 
> It may simplify things a little if you are unswitching on 'a', you can just ask each block with a condition whether 'a's range can be modified....
> 
> Andrew.
> 
> 
> 


  reply	other threads:[~2021-12-09 12:59 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  8:46 Martin Liška
2021-09-19 16:50 ` Jeff Law
2021-09-28 11:50 ` Richard Biener
2021-09-28 20:39   ` Andrew MacLeod
2021-09-29  8:43     ` Richard Biener
2021-09-29 15:20       ` Andrew MacLeod
2021-09-29 15:28         ` Jeff Law
2021-09-29 15:59           ` Andrew MacLeod
2021-09-30  7:33           ` Richard Biener
2021-11-08 15:05     ` Martin Liška
2021-11-08 18:34       ` Andrew MacLeod
2021-11-08 19:45       ` Andrew MacLeod
2021-11-09 13:37         ` Richard Biener
2021-11-09 16:41           ` Andrew MacLeod
2021-11-10  7:52             ` Aldy Hernandez
2021-11-10  8:50             ` Richard Biener
2021-11-09 16:44           ` Martin Liška
2021-11-10  8:59             ` Richard Biener
2021-11-10 13:29               ` Martin Liška
2021-11-11  7:15                 ` Richard Biener
2021-11-16 13:53                   ` Martin Liška
2021-11-19  9:49                     ` Richard Biener
2021-11-16 14:40                   ` Martin Liška
2021-11-19 10:00                     ` Richard Biener
2021-11-22 15:06                       ` Martin Liška
2021-11-23 13:58                         ` Richard Biener
2021-11-23 15:20                           ` Martin Liška
2021-11-23 16:36                             ` Martin Liška
2021-11-24  8:00                               ` Richard Biener
2021-11-24 10:48                                 ` Martin Liška
2021-11-24 12:48                                   ` Richard Biener
2021-11-24 14:14                                     ` Martin Liška
2021-11-24 14:32                                       ` Martin Liška
2021-11-26  8:12                                         ` Richard Biener
2021-11-29 12:45                                           ` Martin Liška
2021-11-30 11:17                                             ` Richard Biener
2021-12-01 14:10                                               ` Martin Liška
2021-12-01 14:19                                                 ` Richard Biener
2021-12-01 14:25                                                   ` Martin Liška
2021-12-01 14:34                                                     ` Richard Biener
2021-12-01 14:48                                                       ` Martin Liška
2021-12-01 18:21                                                         ` Andrew MacLeod
2021-12-02 11:45                                                           ` Martin Liška
2021-12-02 12:01                                                             ` Richard Biener
2021-12-02 13:10                                                               ` Martin Liška
2021-12-02 13:46                                                                 ` Richard Biener
2021-12-08 21:06                                                                   ` Andrew MacLeod
2021-12-02 14:27                                                             ` Andrew MacLeod
2021-12-02 16:02                                                               ` Martin Liška
2021-12-03 14:09                                                                 ` Andrew MacLeod
2021-12-09 12:59                                                                   ` Martin Liška [this message]
2021-12-09 14:44                                                                     ` Andrew MacLeod
2021-12-09 13:02                                               ` Martin Liška
2022-01-05 12:34                                                 ` Richard Biener
2022-01-06 15:11                                                   ` Andrew MacLeod
2022-01-06 16:02                                                     ` Martin Liška
2022-01-06 16:20                                                       ` Andrew MacLeod
2022-01-06 16:35                                                         ` Martin Liška
2022-01-06 16:42                                                           ` Andrew MacLeod
2022-01-06 16:32                                                       ` Andrew MacLeod
2022-01-06 16:30                                                   ` Martin Liška
2022-01-13 16:01                                                     ` Martin Liška
2022-01-14  7:23                                                       ` Richard Biener
2021-11-25 10:38                                 ` Aldy Hernandez
2021-11-26  7:45                                   ` Richard Biener
2021-11-24  7:46                             ` Richard Biener
2021-10-05 17:08   ` Andrew MacLeod

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=229e3b6e-74f8-e538-db6d-1ce1d3302bff@suse.cz \
    --to=mliska@suse.cz \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).