[llvm] [LoopIdiom] Fix a DL-related crash in optimizeCRCLoop (PR #161509)
    Ramkumar Ramachandra via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Oct  1 06:15:52 PDT 2025
    
    
  
================
@@ -1545,6 +1545,12 @@ bool LoopIdiomRecognize::optimizeCRCLoop(const PolynomialInfo &Info) {
   if (TT.getArch() == Triple::hexagon)
     return false;
 
+  // Check that the DataLayout allows us to index into the new 256-entry CRC
+  // table.
+  Type *IdxTy = SE->getDataLayout().getIndexType(M.getContext(), 0);
+  if (IdxTy->getIntegerBitWidth() < 8)
+    return false;
----------------
artagnon wrote:
Hm, pending on @nikic's expertise, I don't think anything in LLVM would work in the exotic scenario.
https://github.com/llvm/llvm-project/pull/161509
    
    
More information about the llvm-commits
mailing list