HP C/aC++ for PA-RISC Software manual +Orarelycalled, +Onosignedpointers, +Oshortdata

Models: C/aC++ for PA-RISC Software

1 230
Download 230 pages 50.97 Kb
Page 63
Image 63

The +O[no]promote_indirect_calls option uses profile data from profile-based optimization and other information to determine the most likely target of indirect calls and promotes them to direct calls. Indirect calls occur with pointers to functions and virtual calls.

In all cases the optimized code tests to make sure the direct call is being taken and if not, executes the indirect call. If +Oinline is in effect, the optimizer may also inline the promoted calls.

+Opromote_indirect_calls is only effective with profile-based optimization.

NOTE: The optimizer tries to determine the most likely target of indirect calls. If the profile data is incomplete or ambiguous, the optimizer may not select the best target. If this happens, your code’s performance may decrease.

This option can be used at optimization levels 3 and 4. At +O3, it is only effective if indirect calls from functions within a file are mostly to target functions within the same file. This is because +O3 optimizes only within a file, whereas +O4 optimizes across files.

The default is +Opromote_indirect_calls at optimization level 3 and above.

+Onopromote_indirect_calls will be the default at optimization level 2 and below.

+Orarely_called

+Orarely_called=function1[,function2...]

The +Orarely_called option overrides any information in a profile database.

The named functions are assumed to be rarely called

+Orarely_called:filename

The file indicated by filename contains a list of functions, separated by spaces or newlines. These functions are assumed to be rarely called. This option overrides any information in a profile database.

+O[no]signedpointers

+O[no]signedpointers

NOTE: This option is deprecated and may not be supported in future releases.

The +Osignedpointers option treats pointers in Boolean comparisons (for example, <, <=, >, >=) as signed quantities. Applications that allocate shared memory and that compare a pointer to shared memory with a pointer to private memory may run incorrectly if this optimization is enabled.

The default is +Onosignedpointers.

NOTE: This option is supported in C-mode only. A warning is displayed in C++ when this option is used.

+Oshortdata

+Oshortdata[=size]

All objects of [size] bytes or smaller are placed in the short data area, and references to such data assume it resides in the short data area. Valid values of size are a decimal number between 8 and 4,194,304 (4MB).

If no size is specified, all data is placed in the short data area. The default is +Oshortdata=8.

NOTE: Using a value that is too big or without the optional size, possibly through +Ofast, may give various linker fix up errors, if there is more than 4Mb of short data.

Code Optimizing Options 63

Page 63
Image 63
HP C/aC++ for PA-RISC Software manual +Orarelycalled, +Onosignedpointers, +Oshortdata