[llvm] [WASM] Add support for memcmp expansion (PR #148298)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 13 06:55:54 PDT 2025


================
@@ -46,6 +46,10 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
     : TargetLowering(TM), Subtarget(&STI) {
   auto MVTPtr = Subtarget->hasAddr64() ? MVT::i64 : MVT::i32;
 
+  // Set the load count for memcmp expand optimization
+  MaxLoadsPerMemcmp = 3;
+  MaxLoadsPerMemcmpOptSize = 2;
----------------
badumbatish wrote:

8/4 w/  `Options.NumLoadsPerBlock = Options.MaxNumLoads;` seems to be better than 3/2

<img width="1180" height="591" alt="Screenshot 2025-07-13 at 6 51 18 AM" src="https://github.com/user-attachments/assets/4fa7cd06-3ad5-4130-9c76-ff0a246903c5" />


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


More information about the llvm-commits mailing list