advice #27001: Detecting compilation with low optimization level. Use optimization option -o2 or higher.
Your compilation uses low-level optimization options (-o1 and below), which prevents the compiler from using its most powerful optimization techniques. You could get substantially better performance using -o2 (or above) optimization. For C6000, optimization option -o2 is required for the software pipelining loop optimization, which is crucial to getting good performance.
The C/C++ compiler is able to perform various optimizations, but you can control the level of these optimizations. High-level optimizations are performed in the optimizer and low-level, target-specific optimizations occur in the code generator. You must use high-level optimizations to achieve optimal code. The easiest way to invoke optimization is to specify the --opt_level=n option on the compiler command line. You can use -On to alias the --opt_level option. The n denotes the level of optimization (0, 1, 2, and 3), which controls the type and degree of optimization.
--opt_level=0 or -O0
--opt_level=1 or -O1 : Performs all --opt_level=0 (-O0)
optimizations, plus:
--opt_level=2 or -O2 : Performs all --opt_level=1 (-O1)
optimizations, plus:
· --opt_level=3 or -O3 : Performs all --opt_level=2
(or -O2) optimizations, plus:Italic text* Removes all
functions that are never called
Note that -o defaults to -o2. In the absence of any -o options, no
optimization is performed. By default, the -o switch optimizes for
performance. This may increase code size. If code size is an
issue, do not reduce the level of optimization. Instead, use the
-ms switch to affect the optimization goal (performance versus
code size).
For more information, see C6000 Compiler: Recommended Compiler Options.
Not using -o2 or higher optimization can significantly hurt performance.
Increase your optimization level; use -o2 or higher to compile.
Want to squeeze a few more Performance Cycles out of your application? Leverage the e2e (Engineer-to-Engineer) online community to get all of your Advice questions answered! Or, give back to the community with your expertise.