[llvm] [LoopIdiom] Use narrower bit widths where possible in `optimizeCRCLoopUsingClmul` (PR #210139)

Sean Clarke via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 06:58:33 PDT 2026


================
@@ -1617,8 +1617,8 @@ bool LoopIdiomRecognize::optimizeCRCLoop(const PolynomialInfo &Info) {
   // bit width is a fast operation on the target.
   // TODO: If clmul exists on the target but not for the required width, it
   // might be possible to split into multiple iterations of reduction.
-  if (TTI->haveFastClmul(ClmulTy)) {
-    optimizeCRCLoopUsingClmul(Info, ClmulTy);
+  if (TTI->haveFastClmul(ClmulMuTy) && TTI->haveFastClmul(ClmulGPTy)) {
----------------
xarkenz wrote:

There's a bit of a snag here-- `BasicTTIImpl::haveFastClmul` needs an `LLVMContext`, so it might just be best to keep the `IntegerType *` parameter.

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


More information about the llvm-commits mailing list