[llvm] [AsmPrint] Correctly factor function entry count when dumping MBB frequencies (PR #67826)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 13:27:08 PDT 2023


mtrofin wrote:

> > I suspect the terminology at use here is that "frequency" means a value relative to the entry block. While I think you are asking for execution "count"s here (like the value you get when you multiply a block frequency with the entry count).
> 
> Right, but I would expect the raw frequency (`BlockFrequency::getFrequency()`) of the entry block to match the function entry count rather than having to use something like `FreqAdjustmentFactor` like is done here. I'd assume this is some artifact of how the MBFI is computed, but maybe I'm missing something?

Ya, the bbs (incl. entry) are given uint64 values such that the rational number obtained when dividing a mbb's value to the entry's value can approximately map over the range of rational numbers representing various basic blocks' measured frequencies. So `F.getEntryCount()` is basically unrelated to the `count` value of the entry basic block.

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


More information about the llvm-commits mailing list