[all-commits] [llvm/llvm-project] c7a5b9: [LoopIdiomRecognize] Enable clmul optimization for...

Sean Clarke via All-commits all-commits at lists.llvm.org
Thu Jul 16 07:53:31 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7a5b9c0ddd1a5e89a3e8b5a79a916f03e0689b7
      https://github.com/llvm/llvm-project/commit/c7a5b9c0ddd1a5e89a3e8b5a79a916f03e0689b7
  Author: Sean Clarke <sclarke at tenstorrent.com>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M llvm/include/llvm/Analysis/HashRecognize.h
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/lib/Analysis/HashRecognize.cpp
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
    M llvm/test/Analysis/HashRecognize/cyclic-redundancy-check.ll
    A llvm/test/Transforms/LoopIdiom/AArch64/cyclic-redundancy-check.ll
    A llvm/test/Transforms/LoopIdiom/RISCV/cyclic-redundancy-check.ll
    A llvm/test/Transforms/LoopIdiom/X86/cyclic-redundancy-check.ll
    M llvm/test/Transforms/LoopIdiom/cyclic-redundancy-check.ll

  Log Message:
  -----------
  [LoopIdiomRecognize] Enable clmul optimization for CRC loops (#203405)

The current `optimizeCRCLoop` function always optimizes CRC loops to use
a 256-entry Sarwate lookup table to process a byte at a time (except on
Hexagon and with optsize). However, some targets are able to process
larger chunks of CRC data with carry-less/polynomial multiplication
instructions. Implement this approach in IR for such targets using the
`llvm.clmul` intrinsic. (Only with optsize for the moment, though.)

Like the current CRC loop optimization, this does not apply to the
Hexagon target, despite it having a `pmpyw` instruction.

Assisted-by: Claude Opus 4.8



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list