Compiler Inline Flags : Disable/Enable In-lining

Compiler flags to Disable/Enable In-lining


For GCC Compiler
-obey-inline

For ICC Compiler

Disable: -no-ip -inline-level=0

All the flags:

-f[no-]inline
Enables [disables] inlining of functions declared with the __inline keyword. Also enables inlining according to the C++ language. Same as -Ob1. -f[no-]inline-functions Enables [disables] function inlining for single file compilation.

-finline-limit=<n>
Lets you specify the maximum size of a function to be inlined.

-inline-level=<n> (i64 only)
Control the level of inline expansion, where <n> may be:
0 -- disables inlining.
1 -- inline functions declared with __inline, and perform C++ inlining.
2 -- inline any function, at the compiler's discretion.

For HP-UX Compiler

Disable: +inline_level 1 (keep those marked inline) or +inline_level 0
+Onoinline
+d

Levels:


Specify num as any value between 0 and 9. Refer to the following table:
numDescription
0 No inlining is done (same effect as the +d option).
1 Only functions marked with inline or implied by the language to be inline are considered for inlining. (This is the default for C++ at +O1)
2 More inlining than level 1. This is the default level at optimization levels +O2, +O3, and +O4.
3-8 Increasing levels of inliner aggressiveness.
9 Attempt to inline all functions other than recursive functions or those with a variable number of arguments.
The default level depends on +Olevel as shown in the following table:
levelnum
0 1
1 1
2 2
3 2
4 2



IBM XLC:  -Q or -qinline

-Q     inline all the functions
-Q!  doesn't inline any function
-Q-name1:name2 (colon separated list of functions) that shouldn't be inlined

-Q+name1:name2 (colon separated list of functions) that should be inlined
-Q=threshold  Sets a size limit on the functions to be inlined. The number of executable statements must be less than or equal to threshold for the function to be inlined. threshold must be a positive integer. The default value is 20.

NOTE: The inline, _inline, _Inline, and __inline language keywords override all -Q options except -Q!
Last modified: Friday, 13 April 2012, 12:36 AM