[PATCH] D35035: [InstCombine] Prevent memcpy generation for small data size

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 2 07:17:56 PDT 2018


hiraditya added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:139
+  // largest legal integer size.
+  unsigned LargestInt = DL.getLargestLegalIntTypeSizeInBits();
+  if (!LargestInt || Size > LargestInt)
----------------
jfb wrote:
> Why does this make sense? I don't understand why we'd want to tie this to the largest legal integer type, and not have it be its own target parameter.
We used 'largest legal integer size' because that will fit in a register for sure. I think making a target specific parameter seems reasonable, or maybe using TargetLowering.h:getMaxStoresPerMemcpy() which is already available.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:140
+  unsigned LargestInt = DL.getLargestLegalIntTypeSizeInBits();
+  if (!LargestInt || Size > LargestInt)
+    return nullptr;
----------------
dmgreen wrote:
> Are the units of these the same? Or is one bits and the other bytes?
Thank you!


https://reviews.llvm.org/D35035





More information about the llvm-commits mailing list