Accelerator Manual (G06.24+, H06.03+)

Accelerator Performance Issues
Accelerator Manual527303-002
6-5
Using ReturnValSize to Eliminate Transitions
Using ReturnValSize to Eliminate Transitions
The Accelerator must know the size of the return values from every procedure called
by the program it is to accelerate, including internal and external procedure calls. The
Accelerator attempts to find the return value size for procedure calls from:
The Binder region of the object file, for internal procedure calls.
The OCTDECS file, for external system procedure calls and language run-time
library routine calls. (The Accelerator reads the OCTDECS file without an
explicit directive to do so.)
The Binder region of the user library specified in a UserLib option, for user
library routine calls.
If the Accelerator cannot find the return value size for a procedure call, it tries to infer
that information from an analysis of the input program. If it cannot infer that information
by such an analysis, it guesses at the missing values, and inserts run-time checks into
the output program to verify its guesses. If such a guess is wrong, then some portion of
the program makes a transition into TNS code on return from the procedure in
question.
To increase program performance, you can use the ReturnValSize option to eliminate
run-time checks of return value sizes and possible transitions into TNS code. These
run-time checks can occur for both external and internal procedure calls.
For procedures with one return value size, specify:
ReturnValSize procedure-name value
where procedure-name is the name of the procedure, and value is the number of 16-bit
words returned by the procedure. Appendix A, Data Type Correspondence and Return
Value Sizes lists the number of 16-bit words returned by data types for each language.
Note that the ReturnValSize UNKNOWN option is used only for program correctness. It
is not a performance issue. The Accelerator always emits a run-time check of its
predicted return value size when you specify a ReturnValSize UNKNOWN option.
The ReturnValSize option can only be used to specify return value sizes for
procedures; you cannot specify return value sizes for subprocedures. The Accelerator
issues Notes 14 or 15 when it must predict the return value size for a subprocedure. A
transition into TNS code only occurs if the Accelerator’s prediction is incorrect. To
eliminate Notes 14 and 15, first try to eliminate any Notes 1, 2, and 3 that occur for the
procedure which contains the subprocedures; eliminating these notes often eliminates
Notes 14 and 15 as well. If Notes 14 or 15 persist, check to see if the predicted and the
actual return value sizes match. If they match, the program does not make a transition
into TNS code and you can ignore the note. If the procedure actually returns different
size values, you must recode the procedure to return only one size value.
Note 14: The following procedures contain subprocedures that
return more than one size value. Accelerator guesses a return
value size at calls to these subprocedures.