On Tue, Dec 9, 2025 at 9:57 PM Andrew Pinski <[email protected]> wrote: > > While moving the phi part of removal of forwarder blocks, > I noticed that I was getting some failures due to "mismatch counts". > I worked around the issue by disabling the case where the forwarder > block would just get merged. I have now gone back and found > the problem is in ldist where it is removing the loop > by changing the exit to always exit but forgot to update > the edge to always probability. This fixes that and > also removes a few of the "mismatch counts". > > Bootstrapped and tested on x86_64-linux-gnu.
OK. Richard. > gcc/ChangeLog: > > PR tree-optimization/103680 > * tree-loop-distribution.cc (destroy_loop): Set probability > of the exit edge to be always. > > Signed-off-by: Andrew Pinski <[email protected]> > --- > gcc/tree-loop-distribution.cc | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gcc/tree-loop-distribution.cc b/gcc/tree-loop-distribution.cc > index fc0cd3952d5..73e5cab9829 100644 > --- a/gcc/tree-loop-distribution.cc > +++ b/gcc/tree-loop-distribution.cc > @@ -1353,6 +1353,7 @@ destroy_loop (class loop *loop) > redirect_edge_pred (exit, src); > exit->flags &= ~(EDGE_TRUE_VALUE|EDGE_FALSE_VALUE); > exit->flags |= EDGE_FALLTHRU; > + exit->probability = profile_probability::always (); > cancel_loop_tree (loop); > rescan_loop_exit (exit, false, true); > > -- > 2.43.0 >
