-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOLT] Use deterministic xxh3 for computing BF/BB hashes #72542
Conversation
The changes is a "completed" version of #65437 with tests -- I didn't know how to commandeer the change so had to create a new PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the tests and cleaning up the code. Please address one comment in test, otherwise looks good.
@@ -5,19 +5,28 @@ RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe | |||
# Testing "usqrt" | |||
RUN: llvm-bolt %t.exe -o /dev/null --b %p/Inputs/blarge_profile_stale.yaml \ | |||
RUN: --print-cfg --print-only=usqrt --infer-stale-profile=1 \ | |||
RUN: --profile-ignore-hash=1 --profile-use-dfs=0 2>&1 | FileCheck %s -check-prefix=CHECK1 | |||
RUN: --profile-ignore-hash=1 --profile-use-dfs=0 --debug-only=bolt-prof 2>&1 | FileCheck %s -check-prefix=CHECK1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add REQUIRES: asserts
for debug logging checks
fc69580
to
6926ed2
Compare
d888bb3
to
5cb1a1d
Compare
5cb1a1d
to
9156275
Compare
std::hash and ADT/Hashing::hash_value are non-deterministic functions whose
results might vary across implementation/process/execution. Using xxh3 instead
for computing hashes of BinaryFunctions and BinaryBasicBlock for stale profile
matching.
(A possible alternative is to use ADT/StableHashing.h based on FNV hashing but
xxh3 seems to be more popular in LLVM)
This is to address #65241.