autoInlineThreshold Optimization Option (OS/2, Windows)

Syntax: Default:
opt(autoInlineThreshold, number) opt(autoInlineThreshold, 0)

This option determines whether the compiler automatically inlines user functions that are smaller than a specified size, and allows users to control the amount of automatic inlining that occurs when opt(autoInlining) is enabled.

This option is available only when opt(autoInline) is set.

By specifying a non-zero threshold number, the compiler will attempt to inline all functions that are smaller than this threshold. With a threshold of 0, the compiler will still inline all functions that it considers worth inlining, but a threshold greater than 0 allows for the automatic inlining of additional functions.

By default, VisualAge C++ does inline functions when optimizing, and does no inlining otherwise. The threshold is set to zero implicitly by opt(autoInline).

The best performance improvement from this option is gained when you optimize your code, by building with opt(level, level) and specifing a level greater than 0.

The threshold for inlining is measured in abstract code units (ACUs), which quantify the size and complexity of a function. You can specify a number in the range 0 to 65535, but the most effective values usually fall between 5 and 25. The actual ACU of a function is based on internal algorithms, and you can only specify an estimate. The following table gives the ACUs for 2 simple functions:

function definition ACUs
int func_one(char a, int b)
{
   if (a != 10) b++;
   else b+=10;
   return (a):
}
33
int func_two(long par1, long par2)
{
   while(par1) {
      if (par2) test3();
      par1--;
   }
   if(par1) testing();
   par1 += par2;
}
51

Even when inlining is turned on, some candidate functions may not actually be inlined due to criteria applied during the compile stage. The compiler outputs a message whenever it inlines a function as a result of the threshold you specify with this option.



C Compilation
Incremental C++ Build
Configuration Files
Inlining


Set Build Options
Build
Optimize your Program


Optimization Options