# Use LLVM Machine Code Analyzer to analyze assembly performance on Arm

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/cross-platform/mca-godbolt/)
- [Background](https://learn.arm.com/learning-paths/cross-platform/mca-godbolt/background/)
- [Run MCA with Arm assembly](https://learn.arm.com/learning-paths/cross-platform/mca-godbolt/running_mca/)
- [Use MCA with Compiler Explorer](https://learn.arm.com/learning-paths/cross-platform/mca-godbolt/mca_on_godbolt/)
- [Next Steps](https://learn.arm.com/learning-paths/cross-platform/mca-godbolt/_next-steps/)

## About this Learning Path

|                                |                                      |
|--------------------------------|--------------------------------------|
| Skill level:                   | Introductory                         |
| Reading time:                  | 1 hr                                 |
| Last updated:                  | 03 Aug 2026                          |

|  |  |
| --- | --- |
| Author: | Asher Dobrescu , Arm |
| Arm IP: | [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors)[Neoverse](https://support.arm.com/?tab=compute-ip&Product%20Type=Infrastructure%20Processors) |
| Tags: | Performance and Architecture<br>Linux<br>Windows<br>macOS<br>Assembly<br>llvm-mca<br>Runbook |

### Who is this for?
This is an introductory topic for developers who want to diagnose performance issues of Arm programs using LLVM Machine Code Analyzer (MCA) and Compiler Explorer.

### What will you learn?
After completing this Learning Path, you'll be able to perform the following tasks:
- Estimate the hardware resource pressure and the number of cycles taken to execute your code snippet using llvm-mca.
- Describe how this estimate can help diagnose possible performance issues.
- Use Compiler Explorer to run llvm-mca.

### Prerequisites
Before starting, you'll need the following prerequisites:
- Familiarity with Arm assembly.
- LLVM version 16 or newer, which includes support for Neoverse V2.

### Summary
You’ll use LLVM Machine Code Analyzer (`llvm-mca`) to reason about Arm assembly performance. You’ll analyze a short six-value sum to estimate cycles and resource pressure, identify bottlenecks, and relate the report to pipeline behavior. You’ll also run `llvm-mca` in Compiler Explorer to compare compiler versions and apply the workflow to other Arm assembly fragments.

### Frequently asked questions

<summary>What result should I expect when I run `llvm-mca` on the `sum_test1.s` example?</summary>
`llvm-mca` prints estimated cycles and hardware resource pressure for the add instructions. Use those metrics to identify possible stalls and the most stressed resources.

<summary>How do I run `llvm-mca` inside Compiler Explorer?</summary>
Open [Compiler Explorer](https://godbolt.org), then select the `llvm-mca` tool integration to analyze your code. You can choose compilers and tools without installing them locally.

<summary>How do I know `llvm-mca` executed correctly on my snippet?</summary>
The report includes an estimated cycle count and a resource-usage breakdown without errors. If it’s missing or incomplete, verify that the input matches the example and rerun the analysis.

**What should I check before analyzing the Arm assembly example?**

Save the provided instructions exactly as shown in `sum_test1.s`. Make sure the registers match the example so the analysis reflects the intended sequence.

**Can I follow this path without installing LLVM locally?**

Yes. Compiler Explorer includes `llvm-mca` and lets you try compiler versions in the browser. For Neoverse V2 support, use LLVM 16 or later.
