<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Analysis/HashRecognize.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>[HashRecognize] Forbid optz when data.next has exit-block user (#165574)</title>
<updated>2025-10-29T21:50:12+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-10-29T21:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3bc9b28fe5bc3775229ceb6e498747970606d7d5'/>
<id>3bc9b28fe5bc3775229ceb6e498747970606d7d5</id>
<content type='text'>
The CRC optimization relies on stripping the auxiliary data completely,
and should hence be forbidden when it has a user in the exit-block.
Forbid this case, fixing a miscompile.

Fixes #165382.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The CRC optimization relies on stripping the auxiliary data completely,
and should hence be forbidden when it has a user in the exit-block.
Forbid this case, fixing a miscompile.

Fixes #165382.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][HashRecognize] Fix compiler warning on Arm 32-bit (#161821)</title>
<updated>2025-10-03T14:58:11+00:00</updated>
<author>
<name>David Spickett</name>
<email>david.spickett@linaro.org</email>
</author>
<published>2025-10-03T14:58:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=78739ff84a5986623684235e1f29e55b754a1594'/>
<id>78739ff84a5986623684235e1f29e55b754a1594</id>
<content type='text'>
```
/home/david.spickett/llvm-project/llvm/lib/Analysis/HashRecognize.cpp:100:54: warning: comparison of integers of different signs:
'typename iterator_traits&lt;ilist_iterator_w_bits&lt;node_options&lt;Instruction, true, false, void, true, BasicBlock&gt;, false, false&gt;&gt;::difference_type' (aka 'int') and 'size_type' (aka 'unsigned int') [-Wsign-compare]
  100 |   return std::distance(Latch-&gt;begin(), Latch-&gt;end()) != Visited.size();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
```

By using Latch-&gt;size() instead.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
/home/david.spickett/llvm-project/llvm/lib/Analysis/HashRecognize.cpp:100:54: warning: comparison of integers of different signs:
'typename iterator_traits&lt;ilist_iterator_w_bits&lt;node_options&lt;Instruction, true, false, void, true, BasicBlock&gt;, false, false&gt;&gt;::difference_type' (aka 'int') and 'size_type' (aka 'unsigned int') [-Wsign-compare]
  100 |   return std::distance(Latch-&gt;begin(), Latch-&gt;end()) != Visited.size();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
```

By using Latch-&gt;size() instead.</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Clarify hdr comment on GF(2^n) (NFC) (#157482)</title>
<updated>2025-09-08T15:57:16+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-09-08T15:57:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9f7877ffa3b8d1cd65c283eb8824babdeaa90504'/>
<id>9f7877ffa3b8d1cd65c283eb8824babdeaa90504</id>
<content type='text'>
Unify explanation for GF(2^n) and GF(2), which was previously
convoluted.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unify explanation for GF(2^n) and GF(2), which was previously
convoluted.</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Strip excess-TC check (#157479)</title>
<updated>2025-09-08T15:23:13+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-09-08T15:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ee312fc182510bc6dda072f51956a9e76f6e2638'/>
<id>ee312fc182510bc6dda072f51956a9e76f6e2638</id>
<content type='text'>
Checking if trip-count exceeds 256 is no longer necessary, as we have
moved away from KnownBits computations to pattern-matching, which is
very cheap and independent of TC.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Checking if trip-count exceeds 256 is no longer necessary, as we have
moved away from KnownBits computations to pattern-matching, which is
very cheap and independent of TC.</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Strip ValueEvolution (#148620)</title>
<updated>2025-09-04T14:52:33+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-09-04T14:52:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c24e9e3d8f7d4913a69a08ab73685c75124a78ab'/>
<id>c24e9e3d8f7d4913a69a08ab73685c75124a78ab</id>
<content type='text'>
The ValueEvolution logic is deeply flawed, and checking that zero-bits
are shifted can be exploited for miscompiles. In an effort to redo
HashRecognize with a pattern-matching based approach, extract and fix
the core logic of ValueEvolution, and strip it completely, showing that
none of the tests rely on the KnownBits computation of ValueEvolution.

Co-authored-by: Piotr Fusik &lt;p.fusik@samsung.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ValueEvolution logic is deeply flawed, and checking that zero-bits
are shifted can be exploited for miscompiles. In an effort to redo
HashRecognize with a pattern-matching based approach, extract and fix
the core logic of ValueEvolution, and strip it completely, showing that
none of the tests rely on the KnownBits computation of ValueEvolution.

Co-authored-by: Piotr Fusik &lt;p.fusik@samsung.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Track visited in ValueEvolution (#147812)</title>
<updated>2025-07-16T14:27:41+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-07-16T14:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10d4652144fb5dd93b1996c6805ba805574e2cd7'/>
<id>10d4652144fb5dd93b1996c6805ba805574e2cd7</id>
<content type='text'>
Require that all Instructions in the Loop are visited by ValueEvolution,
as any stray instructions would complicate life for the optimization.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Require that all Instructions in the Loop are visited by ValueEvolution,
as any stray instructions would complicate life for the optimization.</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Check TC against bitwidth of LHSAux (#144881)</title>
<updated>2025-07-03T17:07:15+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-07-03T17:07:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a695d6b9a726d0059d9bf80341ee567c1153286c'/>
<id>a695d6b9a726d0059d9bf80341ee567c1153286c</id>
<content type='text'>
The trip-count of a CRC algorithm can legitimately be greater than the
bitwidth of the result: what it cannot exceed is the bitwidth of the
data, or LHSAux. crc8.le.tc16 is now successfully recognized as a CRC
algorithm.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The trip-count of a CRC algorithm can legitimately be greater than the
bitwidth of the result: what it cannot exceed is the bitwidth of the
data, or LHSAux. crc8.le.tc16 is now successfully recognized as a CRC
algorithm.</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize][NFC] Add a missing "phi" in a comment (#146702)</title>
<updated>2025-07-02T15:57:26+00:00</updated>
<author>
<name>Piotr Fusik</name>
<email>p.fusik@samsung.com</email>
</author>
<published>2025-07-02T15:57:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1c305f711f860246b9dd60211166afbf3b3d48cd'/>
<id>1c305f711f860246b9dd60211166afbf3b3d48cd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Rewrite arePHIsIntertwined (#144878)</title>
<updated>2025-07-02T14:36:27+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-07-02T14:36:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cbfd0d68ea5084704bd9ff0c6c51e04fa3fff4be'/>
<id>cbfd0d68ea5084704bd9ff0c6c51e04fa3fff4be</id>
<content type='text'>
The test crc8.le.tc16 is a valid CRC algorithm, but isn't recognized as
such due to a buggy arePHIsIntertwined, which is asymmetric in its
PHINode arguments. There is also a fundamental correctness issue: the
core functionality is to match a XOR that's a recurrence in both PHI
nodes, ignoring casts, but the user of the XOR is never checked. Rewrite
and rename the function.

crc8.le.tc16 is still not recognized as a valid CRC algorithm, due to an
incorrect check for loop iterations exceeding the bitwidth of the
result: in reality, it should not exceed the bitwidth of LHSAux, but we
leave this fix to a follow-up.

Co-authored-by: Piotr Fusik &lt;p.fusik@samsung.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test crc8.le.tc16 is a valid CRC algorithm, but isn't recognized as
such due to a buggy arePHIsIntertwined, which is asymmetric in its
PHINode arguments. There is also a fundamental correctness issue: the
core functionality is to match a XOR that's a recurrence in both PHI
nodes, ignoring casts, but the user of the XOR is never checked. Rewrite
and rename the function.

crc8.le.tc16 is still not recognized as a valid CRC algorithm, due to an
incorrect check for loop iterations exceeding the bitwidth of the
result: in reality, it should not exceed the bitwidth of LHSAux, but we
leave this fix to a follow-up.

Co-authored-by: Piotr Fusik &lt;p.fusik@samsung.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[HashRecognize] Make it a non-PM analysis (#144742)</title>
<updated>2025-06-19T11:29:58+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-06-19T11:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=74054cab7a3e04b323828850409343932e975737'/>
<id>74054cab7a3e04b323828850409343932e975737</id>
<content type='text'>
Make HashRecognize a non-PassManager analysis that can be called to get
the result on-demand, creating a new getResult() entry-point. The issue
was discovered when attempting to use the analysis to perform a
transform in LoopIdiomRecognize.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make HashRecognize a non-PassManager analysis that can be called to get
the result on-demand, creating a new getResult() entry-point. The issue
was discovered when attempting to use the analysis to perform a
transform in LoopIdiomRecognize.</pre>
</div>
</content>
</entry>
</feed>
