[llvm] [CodeGen] Improve ExpandMemCmp for more efficient non-register aligned sizes handling (PR #69942)

Clement Courbet via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 04:22:12 PDT 2023


================
@@ -255,6 +255,31 @@ MemCmpExpansion::MemCmpExpansion(
     }
   }
   assert(LoadSequence.size() <= Options.MaxNumLoads && "broken invariant");
+  // This part of code attempts to optimize the LoadSequence by merging allowed
+  // subsequences into single loads of allowed sizes from
+  // `AllowedTailExpansions`. If it is for zero comparison or if no allowed tail
+  // expansions are specified, we exit early.
+  if (IsUsedForZeroCmp || !Options.AllowedTailExpansions.size())
----------------
legrosbuffle wrote:

`Options.AllowedTailExpansions.empty()`

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


More information about the llvm-commits mailing list