Tuning the Compiler
Principle
Select compilers optimized for the Kunpeng 920 architecture. The latest versions are GCC 9.1.0 and GCC 9.2.1. Other alternative compilers include GCC 7 and 8 series.
Procedure
Parameter |
Description |
|---|---|
-O3, -O2 |
The performance of a few application functions is better under -O2. |
-march=armv8.2-a -mtune=tsv110 |
For GNU 9, the Kunpeng 920 architecture can be specified for optimization by setting -march to armv8.2-a and -mtune to tsv110. |
-ftree-vectorize |
This parameter is enabled by default under -O3. |
-finline-functions |
This parameter enables function inlining and is enabled by default under -O3. |
-flto |
This parameter enables Link Time Optimization (LTO) and must be used with compilation and link parameters. |
-ffast-math |
This parameter enables insecure mathematical operations and optimizes mathematical functions. You are not advised to use this parameter in the production environment. |
-Ofast |
This parameter enables the highest performance optimization and is used only for benchmark. It is not recommended for compilation in the production environment. |
-fprofile-generate, -fprofile-use= |
These parameters enable profile-guided optimization (PDO) by compiling the application, running the application (to generate the running information), and compiling the application again (to optimize the application performance by using the running information). The items that you can optimize include function inlining, block ordering, register allocation and branch prediction. These parameters must be used with compilation and link parameters. |