4.7. Function Calls and InliningΒΆ

In some instances, functional calls inhibit optimization. For instance, a loop containing a function call will not be software pipelined if the compiler is not able to inline the called function. In order to enable optimizations such as software pipelining, it may be necessary to define the called function in one of these ways:

  • In the same source file as the call with the "inline" keyword

  • In a .h file included with the #include preprocessor directive, with the called function using the keywords "static inline"

The compiler performs some amount of automatic inlining at the --opt_level=3 and --opt_level=4 optimization levels.

See Software Pipelining to learn more about pipelining.