| United States-English |
|
|
|
![]() |
Parallel Programming Guide for HP-UX Systems: K-Class and V-Class Servers > Chapter 5 Loop and cross-module optimization featuresCross-module cloning |
|
Cloning is the replacement of a call to a routine by a call to a clone of that routine. The clone is optimized differently than the original routine. Cloning can expose additional opportunities for optimization across multiple source files. Cloning at +O4 is performed across all procedures within the program, and is disabled by specifying the +Onoinline command-line option. This option is described “+O[no]inline[=namelist]”. Global and static variable optimizations look for ways to reduce the number of instructions required for accessing global and static variables (COMMON and SAVE variables in Fortran, and extern and static variables in C and C++). The compiler normally generates two machine instructions when referencing global variables. Depending on the locality of the global variables, single machine instructions may sometimes be used to access these variables. The linker rearranges the storage location of global and static data to increase the number of variables that are referenced by single instructions. Because this optimization rearranges the location and data alignment of global variables, follow the programming practices given below:
Inlining substitutes function calls with copies of the function's object code. Only functions that meet the optimizer's criteria are inlined. This may result in slightly larger executable files. However, this increase in size is offset by the elimination of time-consuming procedure calls and procedure returns. See the section “Inlining within a single source file” for an example of inlining. Inlining at +O4 is performed across all procedures within the program. Inlining at +O3 is done within one file. Inlining is affected by the +O[no]inline[=namelist] and +Oinline_budget=n command-line options. See Chapter 7 “Controlling optimization” for more information on these options. |
|||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||