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

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 09:02:26 PDT 2025


================
@@ -0,0 +1,193 @@
+## 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
----------------
yafet-a wrote:

afaiu it isn't on by default, since in [`BinaryPassManager.cpp` (#L248-L253)](https://github.com/llvm/llvm-project/blob/main/bolt/lib/Rewrite/BinaryPassManager.cpp#L248-L253) the `cl::init` option isn't set for `--inline-memcpy`:

```cpp
static cl::opt<bool> StringOps("inline-memcpy",
  cl::desc("inline calls to memcpy and memmove with width-optimized "
           "load/store sequences"),
  cl::ZeroOrMore, cl::cat(BoltOptCategory));
```

Without it the tests fail

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


More information about the llvm-commits mailing list