Comment on Eliminating Go bounds checks with unsafeComments−57016524001modoes profile guided optimisation reduce these checks?−porridgeraisin1moInsofar as PGO helps inlining.−57016524001moI have hunch PGO does detect when bound check can be eliminated.−delamon1moHow so? PGO might indicate that most of the time arguments are in bounds, but that's not enough. It has to be a proof with 100% certainty before bound checks can be removed−porridgeraisin1mobound check elimination exists separately, PGO can help unveil more opportunities for BCE.
Comments
does profile guided optimisation reduce these checks?
Insofar as PGO helps inlining.
I have hunch PGO does detect when bound check can be eliminated.
How so? PGO might indicate that most of the time arguments are in bounds, but that's not enough. It has to be a proof with 100% certainty before bound checks can be removed
bound check elimination exists separately, PGO can help unveil more opportunities for BCE.