https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110852
--- Comment #11 from Jan Hubicka <hubicka at ucw dot cz> --- > > + int p1 = get_predictor_value (*predictor, *probability); > > + int p2 = get_predictor_value (predictor2, probability2); > > + /* If both predictors agrees, it does not matter from which > > s/agrees/agree/ > > > + Consequently failing to fold both means that we will not suceed > > determinging > > s/suceed/succeed/;s/determinging/determining/ Fixed that, thanks! > > Otherwise yes, but I think the code could be still simplified the way I had in > my patch (i.e. drop parts of the r14-2219 changes, and simply assume that > failed recursion for one operand is PRED_UNCONDITIONAL instead of returning > early, and not requiring the operands are INTEGER_CSTs, just that the result > of > the binop folds to INTEGER_CST. 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. The code is still lax if both b and c are predicted to 0 in which case we can work out that combined probability is at least max of the two predictor probabilities, but I was not sure if that is work extra folding overhead. > > -- > You are receiving this mail because: > You are on the CC list for the bug.