public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/103551 - Always set EDGE_EXECUTABLE in ranger vrp.
@ 2022-01-11 19:48 Andrew MacLeod
  2022-01-12  9:02 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew MacLeod @ 2022-01-11 19:48 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

The simplify_and_fold engine uses the EDGE_EXECUTABLE flag to eliminate 
branches:

substitute_and_fold_dom_walker::before_dom_children:

      if (gimple_code (stmt) == GIMPLE_COND)
         {
           if ((EDGE_SUCC (bb, 0)->flags & EDGE_EXECUTABLE)
               ^ (EDGE_SUCC (bb, 1)->flags & EDGE_EXECUTABLE))

... but if certain passes before VRP2 are turned off, the flag can be in 
an uninitialized state upon entry to VRP2.  This patch simply always 
sets EDGE_EXECUTABLE on all edges before invoking ranger and the S&F engine.

Bootstraps on  x86_64-pc-linux-gnu with no regressions.

OK for trunk?

Andrew






[-- Attachment #2: 551.diff --]
[-- Type: text/x-patch, Size: 732 bytes --]

commit 09934a28871701f3cef5175c2a510cd09ec13836
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Jan 11 09:59:21 2022 -0500

    Always set EDGE_EXECUTABLE in VRP2.
    
            PR tree-optimization/103551
            * tree-vrp.c (execute_ranger_vrp): Always set EDGE_EXECUTABLE.

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 804f3171ccc..62946450b13 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -4332,6 +4332,7 @@ execute_ranger_vrp (struct function *fun, bool warn_array_bounds_p)
   scev_initialize ();
   calculate_dominance_info (CDI_DOMINATORS);
 
+  set_all_edges_as_executable (fun);
   gimple_ranger *ranger = enable_ranger (fun);
   rvrp_folder folder (ranger);
   folder.substitute_and_fold ();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] tree-optimization/103551 - Always set EDGE_EXECUTABLE in ranger vrp.
  2022-01-11 19:48 [PATCH] tree-optimization/103551 - Always set EDGE_EXECUTABLE in ranger vrp Andrew MacLeod
@ 2022-01-12  9:02 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2022-01-12  9:02 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: gcc-patches

On Tue, Jan 11, 2022 at 8:49 PM Andrew MacLeod via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> The simplify_and_fold engine uses the EDGE_EXECUTABLE flag to eliminate
> branches:
>
> substitute_and_fold_dom_walker::before_dom_children:
>
>       if (gimple_code (stmt) == GIMPLE_COND)
>          {
>            if ((EDGE_SUCC (bb, 0)->flags & EDGE_EXECUTABLE)
>                ^ (EDGE_SUCC (bb, 1)->flags & EDGE_EXECUTABLE))
>
> ... but if certain passes before VRP2 are turned off, the flag can be in
> an uninitialized state upon entry to VRP2.  This patch simply always
> sets EDGE_EXECUTABLE on all edges before invoking ranger and the S&F engine.
>
> Bootstraps on  x86_64-pc-linux-gnu with no regressions.
>
> OK for trunk?

OK.

> Andrew
>
>
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-12  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 19:48 [PATCH] tree-optimization/103551 - Always set EDGE_EXECUTABLE in ranger vrp Andrew MacLeod
2022-01-12  9:02 ` Richard Biener

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).