This short tutorial describes how to enable optimization remarks and pipe the information they provide to an output file.
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 can help you understand why a loop has not been vectorized.
By default, Arm Fortran Compiler prints compilation information to stderr. Optimization remarks prints this optimization information to the terminal, or you can choose to pipe them to an output file.
To compile with optimization remarks enabled, debug information specified, and pipe the information to an output file, pass the selected above options and debug information to
armflang, and use
armflang -O<level> -Rpass=<option> <example.f90> <debug_information> 2> <output_file.txt>
Example: Fortran example using armflang
This example shows you how to enable and pipe optimization remarks for an example program,
-Rpasswith 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] do i=1
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