public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Andrew Macleod <amacleod@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aldyh/heads/ranger-relational)] make recompute check explicit and seperate. Date: Fri, 16 Apr 2021 13:25:37 +0000 (GMT) [thread overview] Message-ID: <20210416132537.110523857C75@sourceware.org> (raw) https://gcc.gnu.org/g:986d54e68130af7dd166722514aa99f3e5f16a0c commit 986d54e68130af7dd166722514aa99f3e5f16a0c Author: Andrew MacLeod <amacleod@redhat.com> Date: Thu Apr 15 18:40:53 2021 -0400 make recompute check explicit and seperate. Diff: --- gcc/gimple-range-gori.cc | 49 +++++++++++++++++++++--------------------------- gcc/gimple-range-gori.h | 1 + 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 545f0a16059..dfeb3335e47 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -979,33 +979,34 @@ gori_compute::compute_logical_operands (irange &true_range, irange &false_range, } -// Return TRUE if a range can be calcalated for NAME on edge E. +// Return TRUE if NAME can be recomputed on edge E. bool -gori_compute::has_edge_range_p (tree name, edge e) +gori_compute::may_recompute_p (tree name, edge e) { tree dep1 = depend1 (name); tree dep2 = depend2 (name); - // If no edge is specified, check if NAME is an export on any edge. - if (!e) - { - if (is_export_p (name) || (dep1 && is_export_p (dep1)) - || (dep2 && is_export_p (dep2))) - return true; - return false; - } + // If edge is specified, check if NAME can be recalculated on that edge. + if (e) + return ((dep1 && is_export_p (dep1, e->src)) + || (dep2 && is_export_p (dep2, e->src))); - if (is_export_p (name, e->src) - || def_chain_in_bitmap_p (name, exports (e->src))) - return true; + return (dep1 && is_export_p (dep1)) || (dep2 && is_export_p (dep2)); +} - if (dep1 && is_export_p (dep1, e->src)) - return true; - if (dep2 && is_export_p (dep2, e->src)) - return true; - return false; +// Return TRUE if a range can be calcalated for NAME on edge E. + +bool +gori_compute::has_edge_range_p (tree name, edge e) +{ + + // If edge is specified, check if NAME is an export or recalc on that edge. + if (e) + return is_export_p (name, e->src) || may_recompute_p (name, e); + return is_export_p (name) || may_recompute_p (name); + } bool @@ -1088,16 +1089,8 @@ gori_compute::outgoing_edge_range_p (irange &r, edge e, tree name, } } - if (recalc) - { - // If any direct dependencies are exported from this block, try to - // recompute the result using those values.. - tree dep1 = depend1 (name); - tree dep2 = depend2 (name); - if ((dep1 && is_export_p (dep1, e->src)) - || (dep2 && is_export_p (dep2, e->src))) - return recompute (r, e, name); - } + if (recalc && may_recompute_p (name, e)) + return recompute (r, e, name); return false; } diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h index 83f8806f9fd..41c48819b4c 100644 --- a/gcc/gimple-range-gori.h +++ b/gcc/gimple-range-gori.h @@ -150,6 +150,7 @@ public: bool has_edge_range_p (tree name, edge e = NULL); void dump (FILE *f); protected: + bool may_recompute_p (tree name, edge e = NULL); virtual void ssa_range_in_bb (irange &r, tree name, basic_block bb); virtual bool compute_operand_range (irange &r, gimple *stmt, const irange &lhs, tree name,
reply other threads:[~2021-04-16 13:25 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=20210416132537.110523857C75@sourceware.org \ --to=amacleod@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).