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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 04:10:00 PDT 2025


artagnon wrote:

> 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.

> There's also no check for `trunc` possibly stripping significant bits.

The check isn't a correctness check: there is really no way to ensure that the zext/trunc are correct at this point, and we instead rely on the KnownBits propagation for correctness, keeping a weak check at this point.

> Also, what's the use case for `BoToMatch == Instruction::BinaryOpsEnd` ?

In retrospect, this generality is unnecessary: will strip, thanks.

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


More information about the llvm-commits mailing list