[all-commits] [llvm/llvm-project] 8fb748: [Inliner] Don't count a call penalty for foldable ...

Marina Taylor via All-commits all-commits at lists.llvm.org
Fri Nov 29 10:29:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fb748b4a7c45b56c2e4f37c327fd88958ab3758
      https://github.com/llvm/llvm-project/commit/8fb748b4a7c45b56c2e4f37c327fd88958ab3758
  Author: Marina Taylor <marina_taylor at apple.com>
  Date:   2024-11-29 (Fri, 29 Nov 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/InlineCost.h
    M llvm/lib/Analysis/InlineCost.cpp
    A llvm/test/Transforms/Inline/AArch64/memcpy-constant-size.ll
    A llvm/test/Transforms/PhaseOrdering/AArch64/memcpy-constant-size.ll

  Log Message:
  -----------
  [Inliner] Don't count a call penalty for foldable __memcpy_chk and similar (#117876)

When the size is an appropriate constant, __memcpy_chk will turn into a
memcpy that gets folded away by InstCombine. Therefore this patch avoids
counting these as calls for purposes of inlining costs.

This is only really relevant on platforms whose headers redirect memcpy
to __memcpy_chk (such as Darwin). On platforms that use intrinsics,
memcpy and similar functions are already exempt from call penalties.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list