From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Remove get_or_alloc_expression_id
Date: Thu, 19 May 2022 16:16:01 +0200 (CEST) [thread overview]
Message-ID: <20220519141601.7FF6313456@imap2.suse-dmz.suse.de> (raw)
This function is no longer needed.
Bootstrapped and tested on x86_64-unknown-linux-gnu with a change
to assert it is computed when queried.
Pushed.
2022-05-19 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.cc (get_or_alloc_expression_id): Remove.
(add_to_value): Use get_expression_id.
(bitmap_insert_into_set): Likewise.
(bitmap_value_insert_into_set): Likewise.
---
gcc/tree-ssa-pre.cc | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/gcc/tree-ssa-pre.cc b/gcc/tree-ssa-pre.cc
index 34d77f1e2cf..09a5e2055ca 100644
--- a/gcc/tree-ssa-pre.cc
+++ b/gcc/tree-ssa-pre.cc
@@ -384,18 +384,6 @@ lookup_expression_id (const pre_expr expr)
}
}
-/* Return the existing expression id for EXPR, or create one if one
- does not exist yet. */
-
-static inline unsigned int
-get_or_alloc_expression_id (pre_expr expr)
-{
- unsigned int id = lookup_expression_id (expr);
- if (id == 0)
- return alloc_expression_id (expr);
- return expr->id = id;
-}
-
/* Return the expression that has expression id ID */
static inline pre_expr
@@ -729,7 +717,7 @@ add_to_value (unsigned int v, pre_expr e)
set = BITMAP_ALLOC (&grand_bitmap_obstack);
value_expressions[v] = set;
}
- bitmap_set_bit (set, get_or_alloc_expression_id (e));
+ bitmap_set_bit (set, get_expression_id (e));
}
}
@@ -792,7 +780,7 @@ bitmap_insert_into_set (bitmap_set_t set, pre_expr expr)
for the same value to appear in a set. This is needed for
TMP_GEN, PHI_GEN and NEW_SETs. */
bitmap_set_bit (&set->values, val);
- bitmap_set_bit (&set->expressions, get_or_alloc_expression_id (expr));
+ bitmap_set_bit (&set->expressions, get_expression_id (expr));
}
}
@@ -1030,7 +1018,7 @@ bitmap_value_insert_into_set (bitmap_set_t set, pre_expr expr)
{
unsigned int val = get_expr_value_id (expr);
- gcc_checking_assert (expr->id == get_or_alloc_expression_id (expr));
+ gcc_checking_assert (expr->id == get_expression_id (expr));
/* Constant values are always considered to be part of the set. */
if (value_id_constant_p (val))
--
2.35.3
reply other threads:[~2022-05-19 14:16 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=20220519141601.7FF6313456@imap2.suse-dmz.suse.de \
--to=rguenther@suse.de \
--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).