public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFA][PATCH] Use SCEV conditionally within vr-values and evrp range analysis - V2
Date: Tue, 28 Nov 2017 11:55:00 -0000	[thread overview]
Message-ID: <CAFiYyc3YhA+zL9N6WkDJNJ9T7ZkoHm91at3_zu0F0cm=ON4fPA@mail.gmail.com> (raw)
In-Reply-To: <6d9e93c4-25ae-10ce-5e8c-3e28d61b9777@redhat.com>

On Mon, Nov 27, 2017 at 5:43 PM, Jeff Law <law@redhat.com> wrote:
> On 11/23/2017 05:49 AM, Richard Biener wrote:
>> On Thu, Nov 23, 2017 at 1:16 AM, Jeff Law <law@redhat.com> wrote:
>>>
>>> Clients of the evrp range analysis may not have initialized the SCEV
>>> infrastructure, and in fact my not want to (DOM for example).
>>>
>>> Yet inside both vr-values.c and gimple-ssa-evrp-analyze.c we have calls
>>> into SCEV (that will fault/abort if SCEV is not properly initialized).
>>>
>>> This patch allows clients of vr-values.c and gimple-ssa-evrp-analyze.c
>>> to indicate if they want SCEV analysis.
>>>
>>> Bootstrapped and regression tested by itself as well as with the DOM
>>> patches to use EVRP analysis  (which test the "don't want SCEV path).
>>>
>>> OK for the trunk?
>>
>> There's also scev_initialized_p () which you could conveniently use.
> Yea, that worked fine and is (of course) much simpler.
>
> Bootstrapped and regression tested in isolation as well as on top of my
> ongoing work to remove jump threading from tree-vrp.c.
>
> OK for the trunk now?

Ok.

Richard.

> Jeff
>
>
>         * gimple-ssa-evrp-analyze.c
>         (evrp_range_analyzer::record_ranges_from_phis): Only use SCEV to
>         refine ranges if scev_initialized_p returns true.
>         * vr-values.c (vr_values::extract_range_from_phi_node): Likewise.
>
> diff --git a/gcc/gimple-ssa-evrp-analyze.c b/gcc/gimple-ssa-evrp-analyze.c
> index 68a2cdc..38fb0db 100644
> --- a/gcc/gimple-ssa-evrp-analyze.c
> +++ b/gcc/gimple-ssa-evrp-analyze.c
> @@ -176,7 +176,8 @@ evrp_range_analyzer::record_ranges_from_phis (basic_block bb)
>              to use VARYING for them.  But we can still resort to
>              SCEV for loop header PHIs.  */
>           struct loop *l;
> -         if (interesting
> +         if (scev_initialized_p ()
> +             && interesting
>               && (l = loop_containing_stmt (phi))
>               && l->header == gimple_bb (phi))
>           vr_values.adjust_range_with_scev (&vr_result, l, phi, lhs);
> diff --git a/gcc/vr-values.c b/gcc/vr-values.c
> index 2d11861..e617556 100644
> --- a/gcc/vr-values.c
> +++ b/gcc/vr-values.c
> @@ -2935,7 +2935,8 @@ scev_check:
>       scev_check can be reached from two paths, one is a fall through from above
>       "varying" label, the other is direct goto from code block which tries to
>       avoid infinite simulation.  */
> -  if ((l = loop_containing_stmt (phi))
> +  if (scev_initialized_p ()
> +      && (l = loop_containing_stmt (phi))
>        && l->header == gimple_bb (phi))
>      adjust_range_with_scev (vr_result, l, phi, lhs);
>
>

      reply	other threads:[~2017-11-28 11:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23  8:13 [RFA][PATCH] Use SCEV conditionally within vr-values and evrp range analysis Jeff Law
2017-11-23 13:14 ` Richard Biener
2017-11-23 15:32   ` Jeff Law
2017-11-27 16:58   ` [RFA][PATCH] Use SCEV conditionally within vr-values and evrp range analysis - V2 Jeff Law
2017-11-28 11:55     ` Richard Biener [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='CAFiYyc3YhA+zL9N6WkDJNJ9T7ZkoHm91at3_zu0F0cm=ON4fPA@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.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).