From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 460453858D37; Mon, 15 Aug 2022 12:31:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 460453858D37 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2044] Simplify range_on_path_entry X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 4ad200addc3eaf55fba6cc91db3d3b66eabaf3d0 X-Git-Newrev: e236d671d460dd47262accdea2e9d1d80820ae88 Message-Id: <20220815123154.460453858D37@sourceware.org> Date: Mon, 15 Aug 2022 12:31:54 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2022 12:31:54 -0000 https://gcc.gnu.org/g:e236d671d460dd47262accdea2e9d1d80820ae88 commit r13-2044-ge236d671d460dd47262accdea2e9d1d80820ae88 Author: Richard Biener Date: Mon Aug 15 13:03:54 2022 +0200 Simplify range_on_path_entry I've noticed that range_on_path_entry does mightly complicated things that don't make sense to me and the commentary might just be out of date. For the sake of it I replaced it with range_on_entry and statistics show we thread _more_ jumps with that, so better not do magic there. * gimple-range-path.cc (range_on_path_entry): Just call range_on_entry. Diff: --- gcc/gimple-range-path.cc | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index 5ff2c733b4e..78146f5683e 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -153,38 +153,7 @@ path_range_query::range_on_path_entry (vrange &r, tree name) { gcc_checking_assert (defined_outside_path (name)); basic_block entry = entry_bb (); - - // Prefer to use range_of_expr if we have a statement to look at, - // since it has better caching than range_on_edge. - gimple *last = last_stmt (entry); - if (last) - { - if (m_ranger->range_of_expr (r, name, last)) - return; - gcc_unreachable (); - } - - // If we have no statement, look at all the incoming ranges to the - // block. This can happen when we're querying a block with only an - // outgoing edge (no statement but the fall through edge), but for - // which we can determine a range on entry to the block. - Value_Range tmp (TREE_TYPE (name)); - bool changed = false; - r.set_undefined (); - for (unsigned i = 0; i < EDGE_COUNT (entry->preds); ++i) - { - edge e = EDGE_PRED (entry, i); - if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun) - && m_ranger->range_on_edge (tmp, e, name)) - { - r.union_ (tmp); - changed = true; - } - } - - // Make sure we don't return UNDEFINED by mistake. - if (!changed) - r.set_varying (TREE_TYPE (name)); + m_ranger->range_on_entry (r, entry, name); } // Return the range of NAME at the end of the path being analyzed.