From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1011) id 358263858D20; Tue, 30 Apr 2024 21:23:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 358263858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714512227; bh=CSe9eHB5+qi8FQim2uR0pRuS2cNc60/0USRwj9MMyu4=; h=From:To:Subject:Date:From; b=I8QhHl3/GmYYlUZfgcmG0OrftUCFZotOMr44MMwdsCNTr5bwIVTPyVQcldS04Tf5j E645pJ1+8N0hgIdnT9eWWO6Aj/QmP87nUOYwjipUOCsD4ECFGX71RdI8/q5wJYcWFz K1eEV4pEC4+RvRaiD0F6fXV86zIuGPsxegw3f5Gc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrew Macleod To: gcc-cvs@gcc.gnu.org Subject: [gcc r15-78] Remove wrapper around gimple_range_global. X-Act-Checkin: gcc X-Git-Author: Andrew MacLeod X-Git-Refname: refs/heads/master X-Git-Oldrev: 1ff71f71a13f5ed423389d20ed34f3217e632777 X-Git-Newrev: 56aa8ad7cd91fbc42123f1190d3238e293020085 Message-Id: <20240430212347.358263858D20@sourceware.org> Date: Tue, 30 Apr 2024 21:23:47 +0000 (GMT) List-Id: https://gcc.gnu.org/g:56aa8ad7cd91fbc42123f1190d3238e293020085 commit r15-78-g56aa8ad7cd91fbc42123f1190d3238e293020085 Author: Andrew MacLeod Date: Tue Feb 20 12:27:51 2024 -0500 Remove wrapper around gimple_range_global. Now that legacy EVRP has been removed, we can remove the wrapper which prevented us from using global names before inlining except under some specific conditions. See discussion: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571709.html * value-query.cc (get_range_global): Rename to gimple_range_global. (gimple_range_global): Remove wrapper function. (global_range_query::range_of_expr): Call gimple_range_global. Diff: --- gcc/value-query.cc | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/gcc/value-query.cc b/gcc/value-query.cc index 052b7511565..e88c8e25789 100644 --- a/gcc/value-query.cc +++ b/gcc/value-query.cc @@ -280,11 +280,15 @@ get_ssa_name_ptr_info_nonnull (const_tree name) // Update the global range for NAME into the SSA_RANGE_NAME_INFO and // Return the legacy global range for NAME if it has one, otherwise // return VARYING. +// See discussion here regarding why there use to be a wrapper function: +// https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571709.html +// Legacy EVRP has been removed, leaving just this function. -static void -get_range_global (vrange &r, tree name, struct function *fun = cfun) +void +gimple_range_global (vrange &r, tree name, struct function *fun) { tree type = TREE_TYPE (name); + gcc_checking_assert (TREE_CODE (name) == SSA_NAME); if (SSA_NAME_IS_DEFAULT_DEF (name)) { @@ -332,36 +336,6 @@ get_range_global (vrange &r, tree name, struct function *fun = cfun) r.set_varying (type); } -// This is where the ranger picks up global info to seed initial -// requests. It is a slightly restricted version of -// get_range_global() above. -// -// The reason for the difference is that we can always pick the -// default definition of an SSA with no adverse effects, but for other -// SSAs, if we pick things up to early, we may prematurely eliminate -// builtin_unreachables. -// -// Without this restriction, the test in g++.dg/tree-ssa/pr61034.C has -// all of its unreachable calls removed too early. -// -// See discussion here: -// https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571709.html - -void -gimple_range_global (vrange &r, tree name, struct function *fun) -{ - tree type = TREE_TYPE (name); - gcc_checking_assert (TREE_CODE (name) == SSA_NAME); - - if (SSA_NAME_IS_DEFAULT_DEF (name) || (fun && fun->after_inlining) - || is_a (SSA_NAME_DEF_STMT (name))) - { - get_range_global (r, name, fun); - return; - } - r.set_varying (type); -} - // ---------------------------------------------- // global_range_query implementation. @@ -373,7 +347,7 @@ global_range_query::range_of_expr (vrange &r, tree expr, gimple *stmt) if (!gimple_range_ssa_p (expr)) return get_tree_range (r, expr, stmt); - get_range_global (r, expr); + gimple_range_global (r, expr); return true; }