From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Subject: [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info.
Date: Mon, 1 Aug 2022 08:15:38 +0200 [thread overview]
Message-ID: <20220801061540.229684-1-aldyh@redhat.com> (raw)
Even though ranger is type agnostic, SCEV seems to only work with
integers. This patch removes some FIXME notes making it explicit that
bounds_of_var_in_loop only works with iranges.
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_phi): Only
query SCEV for integers.
(fold_using_range::range_of_ssa_name_with_loop_info): Remove
irange check.
---
gcc/gimple-range-fold.cc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index 6f907df5bf5..7665c954f2b 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -853,12 +853,14 @@ fold_using_range::range_of_phi (vrange &r, gphi *phi, fur_source &src)
}
// If SCEV is available, query if this PHI has any knonwn values.
- if (scev_initialized_p () && !POINTER_TYPE_P (TREE_TYPE (phi_def)))
+ if (scev_initialized_p ()
+ && !POINTER_TYPE_P (TREE_TYPE (phi_def))
+ && irange::supports_p (TREE_TYPE (phi_def)))
{
- value_range loop_range;
class loop *l = loop_containing_stmt (phi);
if (l && loop_outer (l))
{
+ int_range_max loop_range;
range_of_ssa_name_with_loop_info (loop_range, phi_def, l, phi, src);
if (!loop_range.varying_p ())
{
@@ -1337,9 +1339,7 @@ fold_using_range::range_of_ssa_name_with_loop_info (irange &r, tree name,
{
gcc_checking_assert (TREE_CODE (name) == SSA_NAME);
tree min, max, type = TREE_TYPE (name);
- // FIXME: Remove the supports_p() once all this can handle floats, etc.
- if (irange::supports_p (type)
- && bounds_of_var_in_loop (&min, &max, src.query (), l, phi, name))
+ if (bounds_of_var_in_loop (&min, &max, src.query (), l, phi, name))
{
if (TREE_CODE (min) != INTEGER_CST)
{
--
2.37.1
next reply other threads:[~2022-08-01 6:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 6:15 Aldy Hernandez [this message]
2022-08-01 6:15 ` [COMMITTED] const_tree conversion of vrange::supports_* Aldy Hernandez
2022-08-01 6:15 ` [COMMITTED] Cleanups to frange Aldy Hernandez
2022-08-02 7:19 ` [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info Richard Biener
2022-08-02 11:40 ` Aldy Hernandez
2022-08-02 12:06 ` Richard Biener
2022-08-02 12:11 ` Aldy Hernandez
2022-08-02 12:14 ` Richard Biener
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=20220801061540.229684-1-aldyh@redhat.com \
--to=aldyh@redhat.com \
--cc=gcc-patches@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: link
Be 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).