[llvm] [LoopIdiomRecognizer] Implement CRC recognition (PR #79295)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 23:33:33 PST 2024


mgudim wrote:

> So the return value is the quotient? Doesn't that complicate the expression of CRC? What we need for CRC is surely something like premstep instead?

Yes, you're right. Actually, maybe we need both? In coremark after we emit crc8 intinsic, after inlining they combine to a larger crc (32 I think). To recognize that, we need to see that after doing 8-bit crc we continue with the quotient that we got, right? My memory is vague on this, so please correct me if I am wrong.

Sorry for all the noise. Looks like we only need the remainder after all. The identity is something like:

```
prem((prem(x, d, k_1) << s) || y), d, k_2) = prem((x <<s ) || y, d, k_1 + k_2
```


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


More information about the llvm-commits mailing list