[llvm] [LoopIdiomRecognize] Enable clmul optimization for CRC loops (PR #203405)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 13 03:29:08 PDT 2026


================
@@ -87,6 +104,11 @@ class HashRecognize {
   LLVM_ABI static CRCTable genSarwateTable(const APInt &GenPoly,
                                            bool ByteOrderSwapped);
 
+  // Auxilary entry point after analysis to generate constants for a
+  // Barrett-style reduction.
+  LLVM_ABI static CRCBarrettConstants
+  genBarrettConstants(const APInt &GenPoly, bool ByteOrderSwapped);
----------------
artagnon wrote:

```suggestion
  LLVM_ABI static APInt genBarrettReciprocal(const APInt &GenPoly);
```

I think we just need the reciprocal, which should not depend on ByteOrderSwapped?

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


More information about the llvm-commits mailing list