Developer Guide and Reference

Contents

Disable or Decrease the Amount of Inlining

Inlining replaces a call to a function with the body of the function. This lets the compiler optimize the code for the inlined function in the context of its caller, usually yielding more specialized and better performing code. This also removes the overhead of calling the function at run-time.
However, replacing a call to a function by the code for that function usually increases code size. The code size increase can be substantial. To eliminate this code size increase, at the cost of the potential performance improvement, inlining can be disabled.
As an alternative to completely disabling inlining, the default amount of inlining can be decreased by using an inline factor less than the default value of 100. It corresponds to scaling the default values of the main inlining parameters by
n
%.
Options to specify:
To disable inlining:
Linux*
and
macOS*
:
-fno-inline
Windows*:
/Ob0
To reduce inlining and factor the main inlining parameters:
Linux*
and
macOS*
:
-inline-factor
=
n
Windows*:
/Qinline-factor
:
n
To fine tune the main inlining parameters:
Linux*
and
macOS*
:
  • -inline-factor
  • -inline-max-per-compile
  • -inline-max-per-routine
  • -inline-max-size
  • -inline-max-total-size
  • -inline-min-size
Windows*: