public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>, Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org, Andrew MacLeod <amacleod@redhat.com>
Subject: Re: [PATCH] forwprop: Further fixes for simplify_rotate [PR108440]
Date: Thu, 19 Jan 2023 10:34:50 +0100	[thread overview]
Message-ID: <f1ab5a15-2a12-6316-5bd5-25444f2022d6@redhat.com> (raw)
In-Reply-To: <Y8kCLT9lHooHB2Ti@tucnak>



On 1/19/23 09:41, Jakub Jelinek wrote:

> +	  range_query *q = get_range_query (cfun);
> +	  if (q == get_global_range_query ())
> +	    q = enable_ranger (cfun);

Oh, neat.  Clever.  I hadn't thought about that.

> +	  if (!q->range_of_expr (r, rotcnt, check_range_stmt))
> +	    {
> +	      if (check_range > 0)
> +		return false;
> +	      r.set_varying (TREE_TYPE (rotcnt));
> +	    }
>   	  int prec = TYPE_PRECISION (TREE_TYPE (rotcnt));
>   	  signop sign = TYPE_SIGN (TREE_TYPE (rotcnt));
>   	  wide_int min = wide_int::from (TYPE_PRECISION (rtype), prec, sign);
>   	  wide_int max = wide_int::from (wider_prec - 1, prec, sign);
> -	  int_range<2> r2 (TREE_TYPE (rotcnt), min, max);
> +	  if (check_range < 0)
> +	    max = min;
> +	  int_range<1> r2 (TREE_TYPE (rotcnt), min, max);
 >   	  r.intersect (r2);

Currently int_range<1> is a legacy range (anti ranges and such 
internally).  It's better to use <2> as the use of r2 will have to be 
converted to a multi-range before intersecting.  FYI, <2> is the 
smallest multi-range.

This is really an implementation detail, so don't bother changing it, 
even though it's slightly slower.  In the next release we'll nuke 
legacy, and <1> will mean what you think it means...the smallest range 
with one sub-range (and none of that anti range business internally).

Thanks.
Aldy


      parent reply	other threads:[~2023-01-19  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  8:41 Jakub Jelinek
2023-01-19  8:43 ` Richard Biener
2023-01-19  9:34 ` Aldy Hernandez [this message]

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=f1ab5a15-2a12-6316-5bd5-25444f2022d6@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=rguenther@suse.de \
    /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).