You copied the Doc URL to your clipboard.

Arm Optimization Report

Arm Optimization Report is a new feature of Arm® Compiler for Linux version 20.0 that builds upon the llvm-opt-report tool available in open-source LLVM. Arm Optimization Report makes it easier to see what optimization decisions the compiler is making, in-line with your source code.

Arm Optimization Report helps you answer questions regarding unrolling, vectorization, and interleaving:


Example questions: Was a loop unrolled? If so, what was the unroll factor?

Unrolling is when a scalar loop is transformed to perform multiple iterations at once, but still as scalar instructions.

The unroll factor is the number of iterations of the original loop that are performed at once. Sometimes, loops with known small iteration counts are completely unrolled, such that no loop structure remains. In completely unrolled cases, the unroll factor is the total scalar iteration count.


Example questions: Was a loop vectorized? If so, what was the vectorization factor?

Vectorization is when multiple iterations of a scalar loop are replaced by a single iteration of vector instructions.

The vectorization factor is the number of lanes in the vector unit, and corresponds to the number of scalar iterations performed by each vector instruction


The true vectorization factor is unknown at compile-time for SVE, because SVE supports scalable vectors.

For this reason, when SVE is enabled, Arm Optimization Report reports a vectorization factor that corresponds to a 128-bit SVE implementation.

If you are working with an SVE implementation with a larger vector width (for example, 256 or 512 bits), the number of scalar iterations performed by each vector instruction increases proportionally.

SVE scaling factor = <true SVE vector width> / 128


Example question: What was the interleave count?

Interleaving is a combination of vectorization followed by unrolling; multiple streams of vector instructions are performed in each iteration of the loop.

This combination of vectorization and unrolling information lets you know how many iterations of the original scalar loop are performed in each iteration of the generated code.

Number of scalar iterations = <unroll factor> x <vectorization factor> x <interleave count> x <SVE scaling factor>


The annotations Arm Optimization Report uses to annotate the source code, and the options that can be passed to arm-opt-report are described in the Arm Optimization Report reference.

Table of Contents