<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/bolt/lib/Core/HashUtilities.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>BOLT: Replace MCTargetExpr with MCSpecifierExpr to fix bolt-icf.test on aarch64 host</title>
<updated>2025-06-08T05:35:20+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-06-08T05:35:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cdd0a6c7812d0f94dc18060c7e29d5fd98e10106'/>
<id>cdd0a6c7812d0f94dc18060c7e29d5fd98e10106</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MC] Make generated `MCInstPrinter::getMnemonic` const (NFC) (#114682)</title>
<updated>2024-11-03T17:37:26+00:00</updated>
<author>
<name>Sergei Barannikov</name>
<email>barannikov88@gmail.com</email>
</author>
<published>2024-11-03T17:37:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=eeb987f6f35aa614ed7a555be33d67c5cb1be230'/>
<id>eeb987f6f35aa614ed7a555be33d67c5cb1be230</id>
<content type='text'>
The value returned from the function depends only on the instruction opcode.

As a drive-by, change the type of the argument to const-reference.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The value returned from the function depends only on the instruction opcode.

As a drive-by, change the type of the argument to const-reference.
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Match blocks with calls as anchors (#96596)</title>
<updated>2024-07-10T22:46:47+00:00</updated>
<author>
<name>Shaw Young</name>
<email>58664393+shawbyoung@users.noreply.github.com</email>
</author>
<published>2024-07-10T22:46:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=131eb30584333b61888735b4fefe53dd25b741e0'/>
<id>131eb30584333b61888735b4fefe53dd25b741e0</id>
<content type='text'>
Added another hash level – call hash – following opcode hash matching
for stale block matching. Call hash strings are the concatenation of the
lexicographically ordered names of each blocks’ called functions. This 
change bolsters block matching in cases where some instructions have
been removed or added but calls remain constant.

Test Plan: added match-functions-with-calls-as-anchors.test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added another hash level – call hash – following opcode hash matching
for stale block matching. Call hash strings are the concatenation of the
lexicographically ordered names of each blocks’ called functions. This 
change bolsters block matching in cases where some instructions have
been removed or added but calls remain constant.

Test Plan: added match-functions-with-calls-as-anchors.test.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFC] Clean includes, add license headers (#87200)</title>
<updated>2024-04-01T02:29:45+00:00</updated>
<author>
<name>Amir Ayupov</name>
<email>aaupov@fb.com</email>
</author>
<published>2024-04-01T02:29:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fd38366e4525c5507bbb2a2fc1f7d113a964224e'/>
<id>fd38366e4525c5507bbb2a2fc1f7d113a964224e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Use deterministic xxh3 for computing BF/BB hashes (#72542)</title>
<updated>2023-11-27T22:45:46+00:00</updated>
<author>
<name>spupyrev</name>
<email>spupyrev@users.noreply.github.com</email>
</author>
<published>2023-11-27T22:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e7dd596c68c4c292494ffabb1c89a63c84af8115'/>
<id>e7dd596c68c4c292494ffabb1c89a63c84af8115</id>
<content type='text'>
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 https://github.com/llvm/llvm-project/issues/65241.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 https://github.com/llvm/llvm-project/issues/65241.</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Use llvm::erase_if (NFC)</title>
<updated>2023-10-14T01:22:44+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-10-14T01:22:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=eab5d337f0f62828a991ad7ed7e4257735c48e11'/>
<id>eab5d337f0f62828a991ad7ed7e4257735c48e11</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Always match stale entry blocks</title>
<updated>2023-09-08T22:46:20+00:00</updated>
<author>
<name>spupyrev</name>
<email>spupyrev@fb.com</email>
</author>
<published>2023-09-08T18:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=42da84fda979584ee48a14cc07b723c0362a300f'/>
<id>42da84fda979584ee48a14cc07b723c0362a300f</id>
<content type='text'>
Two (minor) improvements for stale matching:
- always match entry blocks to each other, even if there is a hash mismatch;
- ignore nops in (loose) hash computation.

I record a small improvement in inference quality on my benchmarks. Tests are not affected

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D159488
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two (minor) improvements for stale matching:
- always match entry blocks to each other, even if there is a hash mismatch;
- ignore nops in (loose) hash computation.

I record a small improvement in inference quality on my benchmarks. Tests are not affected

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D159488
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Fine-tuning hash computation for stale matching</title>
<updated>2023-08-31T14:29:02+00:00</updated>
<author>
<name>spupyrev</name>
<email>spupyrev@fb.com</email>
</author>
<published>2023-07-24T17:27:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1256ef274c629ea1f86608a816f33a824679a75d'/>
<id>1256ef274c629ea1f86608a816f33a824679a75d</id>
<content type='text'>
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)

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D156278
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D156278
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT] Use opcode name in hashBlock</title>
<updated>2023-05-09T01:54:29+00:00</updated>
<author>
<name>Amir Ayupov</name>
<email>aaupov@fb.com</email>
</author>
<published>2023-05-09T01:53:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6fcb91b2f756857f1295a28990738b5b6f924226'/>
<id>6fcb91b2f756857f1295a28990738b5b6f924226</id>
<content type='text'>
Use MCInst opcode name instead of opcode value in hashing.

Opcode values are unstable wrt changes to target tablegen definitions,
and we notice that as output mismatches in NFC testing. This makes BOLT YAML
profile tied to a particular LLVM revision which is less portable than
offset-based fdata profile.

Switch to using opcode names which have 1:1 mapping with opcode values for any
given LLVM revision, and are stable wrt modifications to .td files (except of
course modifications to names themselves).

Test Plan:
D150154 is a test commit adding new X86 instruction which shifts opcode values.
With current change, pre-aggregated-perf.test passes in nfc check mode.
Without current change, pre-aggregated-perf.test expectedly fails.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D150005
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use MCInst opcode name instead of opcode value in hashing.

Opcode values are unstable wrt changes to target tablegen definitions,
and we notice that as output mismatches in NFC testing. This makes BOLT YAML
profile tied to a particular LLVM revision which is less portable than
offset-based fdata profile.

Switch to using opcode names which have 1:1 mapping with opcode values for any
given LLVM revision, and are stable wrt modifications to .td files (except of
course modifications to names themselves).

Test Plan:
D150154 is a test commit adding new X86 instruction which shifts opcode values.
With current change, pre-aggregated-perf.test passes in nfc check mode.
Without current change, pre-aggregated-perf.test expectedly fails.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D150005
</pre>
</div>
</content>
</entry>
<entry>
<title>[BOLT][NFC] Add hash computation for basic blocks</title>
<updated>2023-05-02T21:03:47+00:00</updated>
<author>
<name>spupyrev</name>
<email>spupyrev@fb.com</email>
</author>
<published>2023-02-16T18:52:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3e3a926be8a9787d2786e3e3ca879fac0656a824'/>
<id>3e3a926be8a9787d2786e3e3ca879fac0656a824</id>
<content type='text'>
Extending yaml profile format with block hashes, which are used for stale
profile matching. To avoid duplication of the code, created a new class with a
collection of utilities for computing hashes.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D144306
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extending yaml profile format with block hashes, which are used for stale
profile matching. To avoid duplication of the code, created a new class with a
collection of utilities for computing hashes.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D144306
</pre>
</div>
</content>
</entry>
</feed>
