]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PHIOPT: Allow other diamond uses when do_hoist_loads is true
authorAndrew Pinski <apinski@marvell.com>
Thu, 20 Apr 2023 17:56:17 +0000 (10:56 -0700)
committerAndrew Pinski <apinski@marvell.com>
Mon, 24 Apr 2023 15:49:49 +0000 (08:49 -0700)
While working on adding diamond shaped form to match-and-simplify
phiopt, I Noticed that we would not reach there if do_hoist_loads
was true. In the original code before the cleanups it was not
obvious why but after I finished the cleanups, it was just a matter
of removing a continue and that is what this patch does.

This just happens also to fix a bug report that I noticed too.

OK? Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

PR tree-optimization/68894
* tree-ssa-phiopt.cc (tree_ssa_phiopt_worker): Remove the
continue for the do_hoist_loads diamond case.

gcc/tree-ssa-phiopt.cc

index f9d8d6e78b200785d5dbc9931f96b783e08c0670..ce3409b532b2cd4d18a7ac697c599070ec2828e5 100644 (file)
@@ -241,10 +241,7 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p)
                 is likely to perform worse than the well-predicted branch.  */
              && !predictable_edge_p (EDGE_SUCC (bb, 0))
              && !predictable_edge_p (EDGE_SUCC (bb, 1)))
-           {
-             hoist_adjacent_loads (bb, bb1, bb2, bb3);
-             continue;
-           }
+           hoist_adjacent_loads (bb, bb1, bb2, bb3);
        }
 
       gimple_stmt_iterator gsi;