[llvm] [llvm-profdata] Emit error when counter value is greater than 2^56. (PR #69513)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 16:21:21 PDT 2023


aeubanks wrote:

> I think this check should be optional (on by default) and can be toggled by a flag, so that in case other concerns regarding profile data validity come up, we can use the same flag to enable/disable other profile data checks.
> 
> Also is there a reason to choose 2^56 instead of 2^63? @aeubanks Do large counter values originate from arithmetic overflow causing the sign bit being set? In this case we should only check for 2^63

It was a miscompile, so not necessarily an overflow. I think 2^56 will catch more issues and as mentioned in the issue, people shouldn't be hitting that in practice.

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


More information about the llvm-commits mailing list