[llvm] [LoopIdiomRecognizer] Implement CRC recognition (PR #79295)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Thu May 8 11:30:36 PDT 2025
https://github.com/artagnon commented:
While I think the idea of tracking known bits for CRC recognition is sound, I think there are problems with the implementation rolling its own version of KnownBits, creating an unnecessary PValueBits, and not using ConstantRange for the significant-bit check. The way it computes known bits using a Map is sub-optimal, and the patch pattern-matches too strongly. Besides, most of the work of optimizing a CRC is the analysis, and the transform bit is trivial. Also, this can be generalized to polynomial hashes in Galois field of characteristic 2, creating a rationale for a new analysis. I've taken the basic idea of tracking known bits, and implemented something in ~500 lines here: https://github.com/llvm/llvm-project/pull/139120.
https://github.com/llvm/llvm-project/pull/79295
More information about the llvm-commits
mailing list