https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110852
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #11) > I added the early exits to handle the following case. > > a = b * c > > If b is prediced to 0 with predictor1, while c is predicted to 1 with > predictor2 your version will predict a to be 0, but will merge > predictor1 and 2 leading to lower probability than predictor1 alone. > So the early exit will give bit higher chance for not losing > information. I thought the goal was to handle what is in predict-18.c, i.e. b * __builtin_expect (c, 0) or similar. If it is about __builtin_expect_with_probability (b, 42, 0.25) * __builtin_expect_with_probability (c, 0, 0.42) sure, my version will merge the probabilities, while you'll pick the probability from the 0 case.