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

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 14:55:21 PDT 2023


MatzeB wrote:

> Do you have cases where this precision problem manifests itself (e.g., unstable/non-deterministic builds)?

No. I don't have any real-world evidence other than flip-flopping test-cases. Builds are of course deterministic without this patch already in the sense that given the same inputs you get the same binary. On the other hand code can still look wildly different for minor changes in the profile inputs as other areas like inlining likely show similar effects.

> The question is whether we could have a better approach which covers both at the same time (IIUC, rounding handles this, but does not have the nice relativity feature that we have in your PR).

Yes, I apreciate that. This has sparked a lot more (good) discussion than I expected, and it seems a good solution here is more than a "drive-by" patch like this. So I am less sure I want to go down this road and will probably just put this on pause for now (and update the extra test cases in https://github.com/llvm/llvm-project/pull/66285 )

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


More information about the llvm-commits mailing list