[PATCH] D156278: [BOLT] Fine-tuning hash computation for stale matching

Sergey Pupyrev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 15:26:57 PDT 2023


spupyrev created this revision.
Herald added subscribers: treapster, ayermolo, pengfei.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
spupyrev retitled this revision from "[BOLT] better hashing" to "[BOLT] Fine-tuning hash computation for stale matching".
spupyrev edited the summary of this revision.
spupyrev updated this revision to Diff 544554.
spupyrev added a comment.
spupyrev edited the summary of this revision.
Herald added subscribers: wlei, wenlei.
spupyrev updated this revision to Diff 544894.
spupyrev updated this revision to Diff 544896.
spupyrev updated this revision to Diff 544949.
spupyrev published this revision for review.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

minor tweaks


spupyrev added a comment.

fixing tests


spupyrev added a comment.

adding a test check


spupyrev added a comment.

added a test


spupyrev added a comment.

Ready for review now


Fine-tuning hash computation for stale matching:

- introducing a new "loose" basic block hash that allows to match many more blocks than before;
- tweaking params of the inference algorithm that find (slightly) better solutions;
- added more meaningful tests for stale matching.

Tested the changes on several open-source benchmarks (clang, rocksdb, chrome) 
and one prod workload using different compiler modes (LTO/PGO etc). There is
always an improvement in the quality of inferred profiles.
(The current implementation is still not optimal but the diff is a step forward;
I am open to further suggestions)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156278

Files:
  bolt/include/bolt/Core/HashUtilities.h
  bolt/include/bolt/Core/MCPlusBuilder.h
  bolt/lib/Core/HashUtilities.cpp
  bolt/lib/Profile/StaleProfileMatching.cpp
  bolt/lib/Target/X86/X86MCPlusBuilder.cpp
  bolt/test/X86/Inputs/blarge_profile_stale.yaml
  bolt/test/X86/reader-stale-yaml.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156278.544949.patch
Type: text/x-patch
Size: 22712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230727/639b3a52/attachment.bin>


More information about the llvm-commits mailing list