[llvm] [HashRecognize] Rewrite arePHIsIntertwined (PR #144878)

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 09:06:56 PDT 2025


https://github.com/pfusik requested changes to this pull request.

Sorry for my late response. Only today I had more time to analyze the following doubt.

> > This checks if `Needle` and `Reference` are used in a `BinaryOperator`, one directly, one indirectly: through `zext` or `trunc`.  What's the point if we don't check what the `BinaryOperator` is later used for?
> 
> Our real check for whether or not the algorithm is a CRC-loop idiom is the KnownBits propagation. This check is mainly in place so that we don't report a faulty LHSAux: see tests not.crc.dead.msg.bad.use and not.crc.dead.msg.no.use.

Checking that the two phis are somehow xored, but not checking what the xor is used for might catch some negative cases, but is not useful in general. What if the xor result is only written to stdout or an array? I believe we should check that the xor is in the use-def chain of `ConditionalRecurrence.Step`'s condition.

https://github.com/llvm/llvm-project/pull/144878


More information about the llvm-commits mailing list