Optimization remarks provide you with information about the choices made by the compiler. They can be used to see which code has been inlined or to understand why a loop has not been vectorized.
By default, Arm Fortran Compiler prints compilation information to stderr. Using optimization remarks prints this optimization information to the terminal, or it can be piped to an output file.
Enabling optimization remarks
To enable optimization remarks, pass the following
-Rpass options to
armflang as required:
|| Request information about what Arm Compiler has optimized.
|| Request information about what Arm Compiler has analyzed.
|| Request information about what Arm Compiler failed to optimize.
For each flag,
replace <regexp> with an expression for the type of remarks you wish to view.
<regexp> queries are:
loop-vectorize will filter remarks regarding vectorized loops, and
inline for remarks regarding inlining.
To search for all remarks, use the expression
.*. However, this expression should be used with care because a lot of information may be printed depending on the size of your code and the level of optimization performed.
Generate debug information
To generate the required debug information, you must combine the
-Rpass flag with any of the following
|| Emits debug information into the binary.
|| Only emits line table debug information into the binary.
|| Only emits Arm Compiler insights into the binary.
Fortran example using armflang
-Rpass with the regular expression
armflang -O3 -Rpass=loop-vectorize example.F90 -gline-tables-only
This results in the following example output in the terminal:
example.F90:21: vectorized loop (vectorization width: 2, interleaved count: 1)
[-Rpass=loop-vectorize] END DO
Piping optimization remarks to a file
To pipe loop vectorization optimization remarks to a file called
armflang -O3 -Rpass=loop-vectorize -Rpass-analysis=loop-vectorize -Rpass-missed=loop-vectorize example.F90 -gline-tables-only 2> vecreport.txt
- More about Arm Fortran Compiler
- Looking for C/C++? See Using optimization remarks with Arm C/C++ Compiler