[llvm] [BOLT][AArch64] Add support for compact code model (PR #112110)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 09:34:45 PDT 2024


================
@@ -0,0 +1,48 @@
+## Check that llvm-bolt successfully relaxes branches for compact (<128MB) code
+## model.
+
+# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
+# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -static
+# RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=randomN \
+# RUN:   --keep-nops --compact-code-model
+# RUN: llvm-objdump -d --disassemble-symbols=_start %t.bolt | FileCheck %s
+# RUN: llvm-nm -n %t.bolt | FileCheck %s --check-prefix=CHECK-NM
+
+## _start will be split and its main fragment will be separated from other
----------------
smithp35 wrote:

Not a comment about this specific test. Looks like there are cases that can be handled that aren't covered by the tests. For example:
* Reuse of existing branches by multiple conditional branches.
* Only applying to simple functions.
* What happens if compact mode is specified and there is > 128MB of code.
* Single or multiple iterations. I'm not well versed enough in bolt to confidently know which one the current test case handles.

I'm not sure what the overall policy is in BOLT for test coverage as I expect non trivial test cases to be difficult to write, please do ignore if this is too much.

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


More information about the llvm-commits mailing list