SPRUIG8J January 2018 – March 2024
In some cases, the compiler can perform better optimization if the code aids the compiler by providing additional information in the code. In such cases, the compiler can prompt you to take certain actions to improve performance, by emitting "advice".
By default, the compiler emits diagnostic messages that suggest changes you can make to the source code to allow the compiler to perform more effective optimizations. To further control performance advice generation, use the following options:
--advice:performance | Instruct the compiler to emit advice to stdout (on by default). Compile with --advice:performance=none to fully disable generation of performance advice. | |
--advice:performance_file | Instruct the compiler to send advice to a file. | |
--advice:performance_dir | Instruct the compiler to send advice to a file in a specific directory. | |
--diag_suppress | Disable advice on a per-diagnostic basis. This option can also be used in the FUNCTION_OPTIONS pragma (see Section 5.8.20). |
Example 1: The following command line sends output advice to a file
named myfile.adv
:
cl7x --advice:performance_file=myfile.adv loop.c
Example 2: The following command lines show two
ways to send output advice to a file named myfile.adv
in the
mydir
subdirectory:
cl7x --advice:performance_file=myfile.adv --advice:performance_dir=mydir loop.c
cl7x --advice:performance_file=mydir/myfile.adv loop.c
The subsections that follow describe the supported advice diagnostics.