From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Subject: [COMMITTED] Inline unsupported_range constructor.
Date: Fri, 5 Aug 2022 14:07:12 +0200 [thread overview]
Message-ID: <20220805120712.79141-1-aldyh@redhat.com> (raw)
An unsupported_range temporary is instantiated in every Value_Range
for completeness sake and should be mostly a NOP. However, it's
showing up in the callgrind stats, because it's not inline. This
fixes the oversight.
PR tree-optimization/106514
gcc/ChangeLog:
* value-range.cc (unsupported_range::unsupported_range): Move...
* value-range.h (unsupported_range::unsupported_range): ...here.
(unsupported_range::set_undefined): New.
---
gcc/value-range.cc | 6 ------
gcc/value-range.h | 10 +++++++++-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index dd5a4303908..a2273f540e8 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -248,12 +248,6 @@ irange::set_nonnegative (tree type)
set (build_int_cst (type, 0), TYPE_MAX_VALUE (type));
}
-unsupported_range::unsupported_range ()
-{
- m_discriminator = VR_UNKNOWN;
- set_undefined ();
-}
-
void
frange::accept (const vrange_visitor &v) const
{
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 305e2cae7e6..856947d23dd 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -250,7 +250,15 @@ private:
class unsupported_range : public vrange
{
public:
- unsupported_range ();
+ unsupported_range ()
+ {
+ m_discriminator = VR_UNKNOWN;
+ set_undefined ();
+ }
+ virtual void set_undefined () final override
+ {
+ m_kind = VR_UNDEFINED;
+ }
virtual void accept (const vrange_visitor &v) const override;
};
--
2.37.1
reply other threads:[~2022-08-05 12:07 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=20220805120712.79141-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).