aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2025-03-20 15:08:33 +0100
committerRichard Biener <rguenth@gcc.gnu.org>2025-03-20 19:08:02 +0100
commit607f92597c3047d7813a981450a7493bca014324 (patch)
tree3c62bce78c8bb79038289c152eaf17782e5d6ddd
parent8b13fc68a10fc57ed5d995c55b0a79e0141e6b81 (diff)
downloadgcc-607f92597c3047d7813a981450a7493bca014324.zip
gcc-607f92597c3047d7813a981450a7493bca014324.tar.gz
gcc-607f92597c3047d7813a981450a7493bca014324.tar.bz2
tree-optimization/119389 - limit edge processing in dominated_by_p_w_unex
The following removes quadraticness when visiting each predecessor of a large CFG merge with dominated_by_p_w_unex. PR tree-optimization/119389 * tree-ssa-sccvn.cc (dominated_by_p_w_unex): Limit the number of predecessors of a CFG merge we try to skip.
-rw-r--r--gcc/tree-ssa-sccvn.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
index 40c38fa..481ab8b 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
@@ -5172,7 +5172,11 @@ dominated_by_p_w_unex (basic_block bb1, basic_block bb2, bool allow_back)
/* Iterate to the single successor of bb2 with only a single executable
incoming edge. */
else if (EDGE_COUNT (bb2->succs) == 1
- && EDGE_COUNT (single_succ (bb2)->preds) > 1)
+ && EDGE_COUNT (single_succ (bb2)->preds) > 1
+ /* Limit the number of edges we check, we should bring in
+ context from the iteration and compute the single
+ executable incoming edge when visiting a block. */
+ && EDGE_COUNT (single_succ (bb2)->preds) < 8)
{
edge prede = NULL;
FOR_EACH_EDGE (e, ei, single_succ (bb2)->preds)