public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2436] Unify MAX_POSTDOM_CHECK and --param uninit-control-dep-attempts Date: Mon, 5 Sep 2022 13:15:25 +0000 (GMT) [thread overview] Message-ID: <20220905131525.4E0CB385AC1F@sourceware.org> (raw) https://gcc.gnu.org/g:e9ea2688271bd0b4319bdfb1fc852169ab3cf076 commit r13-2436-ge9ea2688271bd0b4319bdfb1fc852169ab3cf076 Author: Richard Biener <rguenther@suse.de> Date: Mon Sep 5 14:21:01 2022 +0200 Unify MAX_POSTDOM_CHECK and --param uninit-control-dep-attempts The following unifies both limits, in particular the MAX_POSTDOM_CHECK tends to be too low and is not user-controllable. * gimple-predicate-analysis.cc (MAX_POSTDOM_CHECK): Remove. (compute_control_dep_chain): Move uninit-control-dep-attempts checking where it also counts the post-dominator check invocations. Diff: --- gcc/gimple-predicate-analysis.cc | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc index 5629a6dc277..6684aa6c179 100644 --- a/gcc/gimple-predicate-analysis.cc +++ b/gcc/gimple-predicate-analysis.cc @@ -52,10 +52,6 @@ #define MAX_NUM_CHAINS 8 #define MAX_CHAIN_LEN 5 -/* When enumerating paths between two blocks this limits the number of - post-dominator skips between two edges possibly defining a predicate. */ -#define MAX_POSTDOM_CHECK 8 - /* The limit for the number of switch cases when we do the linear search for the case corresponding to an edge. */ #define MAX_SWITCH_CASES 40 @@ -1010,15 +1006,6 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb, if (single_succ_p (dom_bb)) return false; - if (*num_calls > (unsigned)param_uninit_control_dep_attempts) - { - if (dump_file) - fprintf (dump_file, "param_uninit_control_dep_attempts exceeded: %u\n", - *num_calls); - return false; - } - ++*num_calls; - /* FIXME: Use a set instead. */ unsigned cur_chain_len = cur_cd_chain.length (); if (cur_chain_len > MAX_CHAIN_LEN) @@ -1048,7 +1035,6 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb, edge_iterator ei; FOR_EACH_EDGE (e, ei, dom_bb->succs) { - int post_dom_check = 0; if (e->flags & (EDGE_FAKE | EDGE_ABNORMAL | EDGE_DFS_BACK)) continue; @@ -1088,6 +1074,17 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb, if (in_region != 0 && !(cd_bb->flags & in_region)) break; + /* Count the number of steps we perform to limit compile-time. + This should cover both recursion and the post-dominator walk. */ + if (*num_calls > (unsigned)param_uninit_control_dep_attempts) + { + if (dump_file) + fprintf (dump_file, "param_uninit_control_dep_attempts " + "exceeded: %u\n", *num_calls); + return false; + } + ++*num_calls; + /* Check if DEP_BB is indirectly control-dependent on DOM_BB. */ if (!single_succ_p (cd_bb) && compute_control_dep_chain (cd_bb, dep_bb, cd_chains, @@ -1105,9 +1102,7 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb, && single_succ_edge (cd_bb)->flags & EDGE_DFS_BACK) break; cd_bb = get_immediate_dominator (CDI_POST_DOMINATORS, cd_bb); - post_dom_check++; - if (cd_bb == EXIT_BLOCK_PTR_FOR_FN (cfun) - || post_dom_check > MAX_POSTDOM_CHECK) + if (cd_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)) break; } cur_cd_chain.pop ();
reply other threads:[~2022-09-05 13:15 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220905131525.4E0CB385AC1F@sourceware.org \ --to=rguenth@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /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: linkBe 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).