<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/CodeGen/MachineStableHash.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>Fix the usage issue of getRegMask. (#141215)</title>
<updated>2025-11-02T04:55:08+00:00</updated>
<author>
<name>wdx727</name>
<email>wudexin@kuaishou.com</email>
</author>
<published>2025-11-02T04:55:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=befae81fa2559a7cefa8fe6227149c6147e1eb2f'/>
<id>befae81fa2559a7cefa8fe6227149c6147e1eb2f</id>
<content type='text'>
In the process of determining whether two MachineOperands are equal and
calculating the hash of a MachineOperand, both MO_RegisterMask and
MO_RegisterLiveOut types were uniformly handled. However, when the type
is MO_RegisterLiveOut, calling getRegMask() triggers an assertion
failure. This PR addresses this issue.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the process of determining whether two MachineOperands are equal and
calculating the hash of a MachineOperand, both MO_RegisterMask and
MO_RegisterLiveOut types were uniformly handled. However, when the type
is MO_RegisterLiveOut, calling getRegMask() triggers an assertion
failure. This PR addresses this issue.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Use Register::id(). NFC</title>
<updated>2025-03-06T17:08:21+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-03-06T16:56:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=81089f0fd16e4eaae06f1a4be9611303c4f1cabf'/>
<id>81089f0fd16e4eaae06f1a4be9611303c4f1cabf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[StructuralHash] Global Variable (#118412)"</title>
<updated>2024-12-04T05:33:03+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-12-04T01:28:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4f41862c5a5241654a37ee994ed0074a815d3633'/>
<id>4f41862c5a5241654a37ee994ed0074a815d3633</id>
<content type='text'>
This reverts commit 6a0d6fc2e92bcfb7cb01a4c6cdd751a9b4b4c159.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 6a0d6fc2e92bcfb7cb01a4c6cdd751a9b4b4c159.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[StructuralHash] Global Variable (#118412)"</title>
<updated>2024-12-04T01:19:30+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-12-04T01:19:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6a0d6fc2e92bcfb7cb01a4c6cdd751a9b4b4c159'/>
<id>6a0d6fc2e92bcfb7cb01a4c6cdd751a9b4b4c159</id>
<content type='text'>
This reverts commit 1afb81dfaf902c1c42bd91fec1a7385e6e1529d3.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 1afb81dfaf902c1c42bd91fec1a7385e6e1529d3.
</pre>
</div>
</content>
</entry>
<entry>
<title>[StructuralHash] Global Variable (#118412)</title>
<updated>2024-12-04T00:01:50+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-12-04T00:01:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1afb81dfaf902c1c42bd91fec1a7385e6e1529d3'/>
<id>1afb81dfaf902c1c42bd91fec1a7385e6e1529d3</id>
<content type='text'>
This update enhances the implementation of structural hashing for global
variables, using their initial contents. Private global variables or
constants are often used for metadata, where their names are not unique.
This can lead to the creation of different hash results although they
could be merged by the linker as they are effectively identical.
- Refine the hashing of GlobalVariables for strings or certain
Objective-C metadata cases that have section names. This can be further
extended to other scenarios.
- Expose StructuralHash for GlobalVariable so that this API can be
utilized by MachineStableHashing, which is also employed in the global
function outliner.

This change significantly improves size reduction by an additional 1% on
the LLD binary when the global function outliner and merger are enabled
together. As discussed in the RFC
https://discourse.llvm.org/t/loh-conflicting-with-machineoutliner/83279/8?u=kyulee-com,
if we disable or relocate the LOH pass, the size impact could increase
to 4%.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This update enhances the implementation of structural hashing for global
variables, using their initial contents. Private global variables or
constants are often used for metadata, where their names are not unique.
This can lead to the creation of different hash results although they
could be merged by the linker as they are effectively identical.
- Refine the hashing of GlobalVariables for strings or certain
Objective-C metadata cases that have section names. This can be further
extended to other scenarios.
- Expose StructuralHash for GlobalVariable so that this API can be
utilized by MachineStableHashing, which is also employed in the global
function outliner.

This change significantly improves size reduction by an additional 1% on
the LLD binary when the global function outliner and merger are enabled
together. As discussed in the RFC
https://discourse.llvm.org/t/loh-conflicting-with-machineoutliner/83279/8?u=kyulee-com,
if we disable or relocate the LOH pass, the size impact could increase
to 4%.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Remove unused includes (NFC) (#115996)</title>
<updated>2024-11-13T07:15:06+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-13T07:15:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=735ab61ac828bd61398e6847d60e308fdf2b54ec'/>
<id>735ab61ac828bd61398e6847d60e308fdf2b54ec</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>[StableHash] Implement stable global name for the hash computation (#106156)</title>
<updated>2024-08-27T22:09:06+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-08-27T22:09:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f9ad24946026c45e22c445f8ebc79b8b651e1dad'/>
<id>f9ad24946026c45e22c445f8ebc79b8b651e1dad</id>
<content type='text'>
LLVM often extends global names by adding suffixes to distinguish unique
identities. However, these suffixes are not always stable across
different runs and build environments. To address this issue, I
implemented `get_stable_name` to ignore such suffixes and obtain the
original name. This approach is not new, as PGO or Bolt already handle
this issue similarly. Using the stable name obtained from
`get_stable_name`, I implemented `stable_hash_name` while utilizing the
same underlying `xxh3_64bit` algorithm as before.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLVM often extends global names by adding suffixes to distinguish unique
identities. However, these suffixes are not always stable across
different runs and build environments. To address this issue, I
implemented `get_stable_name` to ignore such suffixes and obtain the
original name. This approach is not new, as PGO or Bolt already handle
this issue similarly. Using the stable name obtained from
`get_stable_name`, I implemented `stable_hash_name` while utilizing the
same underlying `xxh3_64bit` algorithm as before.</pre>
</div>
</content>
</entry>
<entry>
<title>[StableHash] Implement with xxh3_64bits (#105849)</title>
<updated>2024-08-24T04:53:43+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-08-24T04:53:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7615c0b2eb52b8c5d8e6dfc7f265a87a7a9f3ef5'/>
<id>7615c0b2eb52b8c5d8e6dfc7f265a87a7a9f3ef5</id>
<content type='text'>
This is a follow-up to address a suggestion from
https://github.com/llvm/llvm-project/pull/105619.
The main goal of this change is to efficiently implement stable hash
functions using the xxh3 64bits API.
`stable_hash_combine_range` and `stable_hash_combine_array` functions
are removed and consolidated into a more general `stable_hash_combine`
function that takes an `ArrayRef&lt;stable_hash&gt;` as input.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up to address a suggestion from
https://github.com/llvm/llvm-project/pull/105619.
The main goal of this change is to efficiently implement stable hash
functions using the xxh3 64bits API.
`stable_hash_combine_range` and `stable_hash_combine_array` functions
are removed and consolidated into a more general `stable_hash_combine`
function that takes an `ArrayRef&lt;stable_hash&gt;` as input.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Use stable_hash_combine instead of hash_combine (#105619)</title>
<updated>2024-08-23T13:40:12+00:00</updated>
<author>
<name>Kyungwoo Lee</name>
<email>kyulee@meta.com</email>
</author>
<published>2024-08-23T13:40:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c9b6339ad40cacb729cc714342d443e781fdfca3'/>
<id>c9b6339ad40cacb729cc714342d443e781fdfca3</id>
<content type='text'>
I found the current stable hash is not deterministic across multiple
runs on a specific platform. This is because it uses `hash_combine`
instead of `stable_hash_combine`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I found the current stable hash is not deterministic across multiple
runs on a specific platform. This is because it uses `hash_combine`
instead of `stable_hash_combine`.</pre>
</div>
</content>
</entry>
<entry>
<title>[ADT,CodeGen] Remove stable_hash_combine_string</title>
<updated>2024-07-28T17:14:21+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2024-07-28T17:14:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c53843415ebba4d7c295bcd31bb325bfd08570a6'/>
<id>c53843415ebba4d7c295bcd31bb325bfd08570a6</id>
<content type='text'>
FNV, used by stable_hash_combine_string is extremely slow. For string
hashing with good avalanche effects, we prefer xxh3_64bits.

StableHashing.h might still be useful as it provides a stable
hash_combine while Hashing.h's might be non-deterministic (#96282).

Pull Request: https://github.com/llvm/llvm-project/pull/100668
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FNV, used by stable_hash_combine_string is extremely slow. For string
hashing with good avalanche effects, we prefer xxh3_64bits.

StableHashing.h might still be useful as it provides a stable
hash_combine while Hashing.h's might be non-deterministic (#96282).

Pull Request: https://github.com/llvm/llvm-project/pull/100668
</pre>
</div>
</content>
</entry>
</feed>
