> Does the computed value of very_unlikely need to change for the new > scale? Can the profile machinery provide a helper function or macro > instead of the current calculation replicated in many ports?
And to answer your first question, there is REG_BR_PROB_BASE scale which is not chnaged by my patch and there is also internal scale for profile_probability (which is completely captured by the type) which currently is also set to 10000 to let me compare profiles produced before and after the conversion. I plan to set it to more sane value soon after I am reasonably sure that there is nothing wrong and we don't have code quality regressions related to the revamp. General plan is: 1) fix issues with updating and add verifier that when profile is available all probabilities and counts are initialized 2) eliminate REG_BR_PROB_BASE uses where it is not necessary (we use it for various internal scaling purposes, i.e. when verioning loops) 3) work on removing frequencies (in favour of counts) for callgraph. Because counts have quality now, it is easy to declare that given count was determined by static profile estimation and is function local. 4) remove frequencies from CFG 5) remove edge counts from CFG and keep only probabilities. For this probabilities will need to get more precise (by increasing the scale) 6) work on elimination of REG_BR_PROB_BASE representation from RTL Honza