[llvm] [BOLT][AArch64] Enabling Inlining for Memcpy for AArch64 in BOLT (PR #154929)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 04:09:25 PDT 2025


================
@@ -0,0 +1,285 @@
+## This test checks that BOLT correctly inlines memcpy calls on AArch64.
+
+# REQUIRES: system-linux, aarch64-registered-target
+
+# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
+# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q 
+# RUN: llvm-bolt %t.exe --inline-memcpy -o %t.bolt 2>&1 | FileCheck %s --check-prefix=CHECK-INLINE
+# RUN: llvm-objdump -d %t.bolt | FileCheck %s --check-prefix=CHECK-ASM
+
+# Verify BOLT reports that it inlined memcpy calls (9 successful inlines out of 12 total calls)
+# CHECK-INLINE: BOLT-INFO: inlined 9 memcpy() calls
+
+# Each function should use optimal size-specific instructions and NO memcpy calls
+
----------------
sjoerdmeijer wrote:

Sorry, thought about one more corner case: what if we try to copy 0 bytes? I think we need a test for that. 

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


More information about the llvm-commits mailing list