[llvm] [X86] Do not ignore AlwaysInline when determining if inlining is worth it (PR #87825)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 14:48:59 PDT 2024


================
@@ -66,8 +66,10 @@ SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
   // If not DWORD aligned or size is more than the threshold, call the library.
   // The libc version is likely to be faster for these cases. It can use the
   // address value and run time information about the CPU.
-  if (Alignment < Align(4) || !ConstantSize ||
-      ConstantSize->getZExtValue() > Subtarget.getMaxInlineSizeThreshold()) 
+  if (!ConstantSize ||
+      (!AlwaysInline &&
+       (Alignment < Align(4) ||
+        ConstantSize->getZExtValue() > Subtarget.getMaxInlineSizeThreshold())))
     return SDValue();
----------------
RKSimon wrote:

```cpp
if (!ConstantSize)
  return SDValue();
  
uint64_t SizeVal = ConstantSize->getZExtValue();
if (!AlwaysInline &&
      (Alignment < Align(4) || SizeVal > Subtarget.getMaxInlineSizeThreshold()))
  return SDValue();

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


More information about the llvm-commits mailing list