From 65eaab18b100ab83f1a05501e10b21875c72c299 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 10 Nov 2019 19:15:34 +0100 Subject: [PATCH] Short circuit case where profiles are same. * profile-count.c (profile_count::to_sreal_scale): Short circuit case where profiles are same. From-SVN: r278022 --- gcc/ChangeLog | 5 +++++ gcc/profile-count.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bdc3067e63c..d2c7242d794 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-10 Jan Hubicka + + * profile-count.c (profile_count::to_sreal_scale): Short circuit + case where profiles are same. + 2019-11-10 Jan Hubicka * cgraph.c (cgraph_edge::maybe_hot_p): Do not use sreal_frequency. diff --git a/gcc/profile-count.c b/gcc/profile-count.c index 6198675eb89..6f6c0a9e832 100644 --- a/gcc/profile-count.c +++ b/gcc/profile-count.c @@ -312,6 +312,8 @@ profile_count::to_sreal_scale (profile_count in, bool *known) const *known = true; if (*this == zero ()) return 0; + if (m_val == in.m_val) + return 1; if (!in.m_val) { -- 2.30.2