You copied the Doc URL to your clipboard.

Optimization remarks

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.

Procedure

  1. 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 > <outputfile>:

    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, example.f90.

  1. Pass -Rpass with the regular expression loop-vectorize to armflang, use:

    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
    
  2. Pipe loop vectorization optimization remarks to a file called vecreport.txt, use:

    armflang -O3 -Rpass=loop-vectorize -Rpass-analysis=loop-vectorize
    -Rpass-missed=loop-vectorize example.F90 -gline-tables-only
    2> vecreport.txt
    
Was this page helpful? Yes No