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

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 09:37:21 PDT 2023


WenleiHe wrote:

> > I am curios if there is a way to teach BFI to return appropriately rounded values, so that we don't modify downstream algorithms?
> 
> Yes in fact I started out with code "rounding" all BFI values and still have it around here. 

I also liked the idea of building the rounding into BFI. Initially the rounding can be controlled/enabled by a switch, so we don't suddenly introduce big churns to all PGO users. 

Beyond your need for test case stability, another real benefit of rounding within BFI is that it can help reduce the binary level instability for sample PGO due to nature of sampling.

> But initially I wanted this more of a drive-by fix rather than challenging base layer assumptions which would probably need more discussion from stakeholders...

You are already challenging the base layer in https://github.com/llvm/llvm-project/pull/66285, in a good way though. :) I'd suggest let's do it properly within BFI, rather than in downstream optimization. 

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


More information about the llvm-commits mailing list