About this Learning Path

Who is this for?

This is an introductory topic for developers who have compiled an AArch64 Linux application and want to evaluate whether LLVM BOLT can improve its runtime performance.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Identify whether a program is a good candidate for code layout optimization
  • Install LLVM BOLT on Linux
  • Use LLVM BOLT to perform profile-guided post-link optimization of an AArch64 binary with poor spatial locality
  • Collect profile data using multiple techniques, including BRBE, instrumentation, SPE, and PMU event sampling
  • Evaluate the impact of BOLT optimizations using performance metrics and profiling data

Prerequisites

Before starting, you will need the following:

  • An AArch64 system running Linux with perf installed
  • Linux kernel version 6.17 or later to enable Branch Record Buffer Extension ( BRBE profiling )
  • Linux kernel version 6.14 or later for Arm Statistical Profiling Extension ( SPE profiling )
  • GCC version 13.3 or later to compile the example program ( GCC )
  • A system with with sufficient hardware performance counters to use the TopDown methodology. This typically requires running on bare metal rather than a virtualized environment.

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll apply LLVM BOLT post-link optimization to AArch64 binaries using profile-guided code layout. Starting with a deliberately inefficient BubbleSort workload to make instruction locality issues visible, you’ll install a suitable BOLT release, set up a working directory, and gather profiles with BRBE, SPE, instrumentation, or PMU sampling. Using a small set of Arm TopDown indicators, you’ll judge whether a program is front-end bound and a good candidate for BOLT. You’ll then run BOLT with collected profiles to reorganize code layout and evaluate the impact using performance metrics and profiling data to confirm improvements in instruction delivery and locality.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Which BOLT version should I use if my package manager installs an older release?
Use LLVM BOLT 22.1.0 or later. If your distribution provides an older version, install a prebuilt LLVM release instead (for example, LLVM 22.1.5) to match the required features.
Where do the example’s build and profiling outputs go?
You’ll find outputs in three directories: out for binaries, prof for profile data, and heatmap for visualization artifacts. Keeping these separate makes it easier to rerun steps and compare results.
How do I know if my program is a good candidate for BOLT?
Check a small set of Arm TopDown indicators related to instruction delivery and code locality. Programs that appear front-end bound, with inefficient instruction fetch and poor locality, are strong candidates for code layout optimization with BOLT.
What should I use if my kernel doesn't meet the BRBE or SPE requirements?
If your kernel is older than the BRBE requirement, use SPE if the kernel meets the SPE version requirement. If neither is available, you can use instrumentation or PMU event sampling to collect profiles.
What result should I expect after running BOLT with profiles?
You should be able to evaluate changes using performance metrics and profiling data. Look for improvements in instruction delivery indicators and evidence of better code locality in the optimized binary.
Next