From: Andrew Pinski <apinski@marvell.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Andrew Pinski <apinski@marvell.com>
Subject: [PATCH 1/2] VR-VALUES: Rename op0/op1 to op1/op2 for test_for_singularity
Date: Fri, 1 Sep 2023 10:30:58 -0700 [thread overview]
Message-ID: <20230901173059.791894-1-apinski@marvell.com> (raw)
As requested and make easier to understand with the new ranger
code, rename the arguments op0/op1 to op1/op2.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions
gcc/ChangeLog:
* vr-values.cc (test_for_singularity): Rename
arguments op0/op1 to op1/op2.
---
gcc/vr-values.cc | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc
index a4fddd62841..52ab4fe6109 100644
--- a/gcc/vr-values.cc
+++ b/gcc/vr-values.cc
@@ -903,7 +903,7 @@ simplify_using_ranges::simplify_bit_ops_using_ranges
return true;
}
-/* We are comparing trees OP0 and OP1 using COND_CODE. OP0 has
+/* We are comparing trees OP1 and OP2 using COND_CODE. OP1 has
a known value range VR.
If there is one and only one value which will satisfy the
@@ -913,8 +913,8 @@ simplify_using_ranges::simplify_bit_ops_using_ranges
the conditional, then set *STRICT_OVERFLOW_P to true. */
static tree
-test_for_singularity (enum tree_code cond_code, tree op0,
- tree op1, const value_range *vr)
+test_for_singularity (enum tree_code cond_code, tree op1,
+ tree op2, const value_range *vr)
{
tree min = NULL;
tree max = NULL;
@@ -923,13 +923,13 @@ test_for_singularity (enum tree_code cond_code, tree op0,
written. */
if (cond_code == LE_EXPR || cond_code == LT_EXPR)
{
- min = TYPE_MIN_VALUE (TREE_TYPE (op0));
+ min = TYPE_MIN_VALUE (TREE_TYPE (op1));
- max = op1;
+ max = op2;
if (cond_code == LT_EXPR)
{
- tree one = build_int_cst (TREE_TYPE (op0), 1);
- max = fold_build2 (MINUS_EXPR, TREE_TYPE (op0), max, one);
+ tree one = build_int_cst (TREE_TYPE (op1), 1);
+ max = fold_build2 (MINUS_EXPR, TREE_TYPE (op1), max, one);
/* Signal to compare_values_warnv this expr doesn't overflow. */
if (EXPR_P (max))
suppress_warning (max, OPT_Woverflow);
@@ -937,13 +937,13 @@ test_for_singularity (enum tree_code cond_code, tree op0,
}
else if (cond_code == GE_EXPR || cond_code == GT_EXPR)
{
- max = TYPE_MAX_VALUE (TREE_TYPE (op0));
+ max = TYPE_MAX_VALUE (TREE_TYPE (op1));
- min = op1;
+ min = op2;
if (cond_code == GT_EXPR)
{
- tree one = build_int_cst (TREE_TYPE (op0), 1);
- min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one);
+ tree one = build_int_cst (TREE_TYPE (op1), 1);
+ min = fold_build2 (PLUS_EXPR, TREE_TYPE (op1), min, one);
/* Signal to compare_values_warnv this expr doesn't overflow. */
if (EXPR_P (min))
suppress_warning (min, OPT_Woverflow);
@@ -951,10 +951,10 @@ test_for_singularity (enum tree_code cond_code, tree op0,
}
/* Now refine the minimum and maximum values using any
- value range information we have for op0. */
+ value range information we have for op1. */
if (min && max)
{
- tree type = TREE_TYPE (op0);
+ tree type = TREE_TYPE (op1);
tree tmin = wide_int_to_tree (type, vr->lower_bound ());
tree tmax = wide_int_to_tree (type, vr->upper_bound ());
if (compare_values (tmin, min) == 1)
--
2.31.1
next reply other threads:[~2023-09-01 17:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 17:30 Andrew Pinski [this message]
2023-09-01 17:30 ` [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler Andrew Pinski
2023-09-05 6:06 ` Jeff Law
2023-09-05 7:12 ` Andrew Pinski
2023-09-29 20:17 ` Jeff Law
2023-09-05 5:56 ` [PATCH 1/2] VR-VALUES: Rename op0/op1 to op1/op2 for test_for_singularity Jeff Law
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=20230901173059.791894-1-apinski@marvell.com \
--to=apinski@marvell.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).