https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123126
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2025-12-15
Ever confirmed|0 |1
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since this is PGO. It could be that we are duplicating too much based on the
profile.
That is `e->probability <= profile_probability::very_unlikely ()` is true with
PGO and not without.
- very_unlikely (1/2000 probability)
So for an example you have a loop which loops 2000+ times all the time, the
exit would be considered unlikely and we duplicate that.
So maybe this should be:
```
e->probability <= profile_probability::very_unlikely () &&
!e->probability.reliable_p()
```
Because if we were looking at guessed, probably_never_executed_edge_p sometimes
is true for unreachable/trap (noreturn) cases. BUT if we have a reliable
probability then we can trust the probability and only copy the non-executed
edges.