[llvm] Bfi precision (PR #66285)

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 14:07:26 PDT 2023


david-xl wrote:

> I noticed that we often have poor precision in the `BlockFrequencyInfo` results because of how `convertFloatingToInteger` in the algorithm chooses factors.
> 
> This is a request for comments for choosing more aggressive factors! Look at changes in `test/Analysis/BlockFrequencyInfo/precision.ll` to get an impression for the poor precision and improvements.
> 
> Has this been tried before? Is there history I am not aware of?
> 
> Right now this change does not work yet as it triggers overflows and some instabilities in various places that I am working through. I thought it may be interesting to get some early feedback though in case this change is miguided...

For precision.ll test case, without the patch, we get 388/600 vs 400/600, and 88/288 vs 100/300. How much do we depend on this level of difference? Profile imprecision is an inherent attribute due to other reasons as well for instance race conditions in instrumentation counter update, sampling period difference etc.

https://github.com/llvm/llvm-project/pull/66285


More information about the llvm-commits mailing list