You copied the Doc URL to your clipboard.

Optimization remarks

Optimization remarks provide you with information about the choices made by the compiler. You can use them to see which code has been inlined or they 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 enable optimization remarks, choose from following Rpass options:

  • -Rpass=<regex>: Information about what the compiler has optimized.

  • -Rpass-analysis=<regex>: Information about what the compiler has analyzed.

  • -Rpass-missed=<regex>: Information about what the compiler failed to optimize.

For each option, replace <regex> with an expression for the type of remarks you wish to view.

Recommended <regexp> queries are:

  • -Rpass=\(loop-vectorize\|inline\|loop-unroll)

  • -Rpass-missed=\(loop-vectorize\|inline\|loop-unroll)

  • -Rpass-analysis=\(loop-vectorize\|inline\|loop-unroll)

where loop-vectorize filters remarks regarding vectorized loops, inline for remarks regarding inlining, and loop-unroll for remarks about unrolled loops.

Note

To search for all remarks, use the expression .*. Use this expression with caution; depending on the size of code, and the level of optimization, a lot of information can print.

When you provide -Rpass, armflang generates debug line tables equivalent to passing -gline-tables-only, unless you instruct it not to by another debug controlling option. This default behavior ensures that source location information is available to print the remarks.

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>. For example:

armflang -O<level> -Rpass[-<option>]=<remark> <filename>.f90 <debug_information> 2> <output_file>.txt

Table of Contents