public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/106716] Identical Code Folding (-fipa-icf) confuses between functions with different [[likely]] attributes
       [not found] <bug-106716-4@http.gcc.gnu.org/bugzilla/>
@ 2023-09-05 20:45 ` pinskia at gcc dot gnu.org
  2024-03-10 13:40 ` hubicka at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-05 20:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106716

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moncef.mechri at gmail dot com

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 111297 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug ipa/106716] Identical Code Folding (-fipa-icf) confuses between functions with different [[likely]] attributes
       [not found] <bug-106716-4@http.gcc.gnu.org/bugzilla/>
  2023-09-05 20:45 ` [Bug ipa/106716] Identical Code Folding (-fipa-icf) confuses between functions with different [[likely]] attributes pinskia at gcc dot gnu.org
@ 2024-03-10 13:40 ` hubicka at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: hubicka at gcc dot gnu.org @ 2024-03-10 13:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106716

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The reason why GIMPLE_PREDICT is ignored is that it is never used after ipa-icf
and gets removed at the very beggining of late optimizations.  

GIMPLE_PREDICT is consumed by profile_generate pass which is run before
ipa-icf.  The reason why GIMPLE_PREDICT statements are not stripped during ICF
is early inlining.  If we early inline, we throw away its profile and estimate
it again (in the context of function it was inlined to) and for that it is a
good idea to keep predicts.

There is no convenient place to remove them after early inlining was done and
before IPA passes and that is the only reason why they are around.  We may
revisit that since streaming them to LTO bytecode is probably more harmful then
adding extra pass after early opts to strip them.

ICF doesn't code to compare edge profiles and stmt histograms.  It knows how to
merge them (so resulting BB profile is consistent with merging) but I suppose
we may want to have some threshold on when we do not want to marge functions
with very different branch probabilities in the hot part of their bodies...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-10 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-106716-4@http.gcc.gnu.org/bugzilla/>
2023-09-05 20:45 ` [Bug ipa/106716] Identical Code Folding (-fipa-icf) confuses between functions with different [[likely]] attributes pinskia at gcc dot gnu.org
2024-03-10 13:40 ` hubicka at gcc dot gnu.org

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).