This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Another sreal micro optimization
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 10 Nov 2019 19:16:18 +0100
- Subject: Another sreal micro optimization
Hi,
this is another case where we can save quite some sreal operations
(because it is common that call frequency is the same as entry block bb
frequency)
Bootstrapped/regtested x86_64-linux, comitted.
Honza
* profile-count.c (profile_count::to_sreal_scale): Short circuit
case where profiles are same.
Index: profile-count.c
===================================================================
--- profile-count.c (revision 278020)
+++ profile-count.c (working copy)
@@ -312,6 +312,8 @@ profile_count::to_sreal_scale (profile_c
*known = true;
if (*this == zero ())
return 0;
+ if (m_val == in.m_val)
+ return 1;
if (!in.m_val)
{