[llvm] MachineBlockPlacement: Add tolerance to comparisons (PR #67197)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 12:46:17 PDT 2023


MatzeB wrote:

> Are there any measurable performance impact with this change?

I don't expect any changes as this should only affect cases where frequencies are very close to each other so any choice should have a similar effect. So I haven't benchmarked this so far. I can run it through the llvm-test-suite if desired. (I'm not sure I can sensible measure it with our production workloads as BOLT will reorder all the basic blocks code again anyway for us).

The motivation here is to reduce the amount of reordering that is triggered by inconsequentially small changes in BFI data. I did this because I had to touch most of these tests for https://github.com/llvm/llvm-project/pull/66285 anyway, and it seemed like a good idea to make the algorithm more stable to hopefully reduce churn in the future too.

I could also see this being useful to reduce day-to-day churn as sampling PGO data changed, though that likely needs tuning and tighter values for the `BlockFreqCompBits` constant added here.

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


More information about the llvm-commits mailing list