User`s guide

Improving the Performance of Ported Code
4.3 Code Optimization
REFERENCES
The compiler recognizes that the same data value is referenced multiple
times, and only loads the data once for use by multiple references, subject to
restrictions to ensure that the data being used is not stale.
PEEPHOLE
The compiler identifies instruction sequences that can be identically
performed by smaller instruction sequences, and replaces the longer
sequences with the shorter ones.
SCHEDULING
The compiler uses its knowledge of the nature of the multiple instruction
issue ability of the Alpha and Itanium architectures to reschedule the code
for optimum performance.
VAXREGS (Alpha systems only)
By default, the registers from R13 through R28 may be used as temporary
scratch registers by the compiler if they are not used in the source code.
When VAXREGS is specified, the compiler may also use any of the VAX
register set (R0 through R12) that are not explicitly used by the MACRO
source code. VAX registers used in this way will be restored to their original
values at routine exit unless declared SCRATCH.
Note
Debugging is simplified if you specify /NOOPTIMIZE, because the
optimizations include relocating and rescheduling code. For more
information, see Section 2.13.1.
4.3.1 Using the VAXREGS Optimization (OpenVMS Alpha only)
To use the VAXREGS optimization, you must ensure that all routines correctly
declare their register usage in their .CALL_ENTRY, .JSB_ENTRY, or .JSB32_
ENTRY routine declarations. In addition, you must identify any VAX registers
that are required or modified by any routines that are called. By default, the
compiler assumes that no VAX registers are required as input to any called
routine, and that all VAX registers except R0 and R1 are preserved across
the call. To declare this usage, use the READ and WRITTEN qualifiers to the
compiler directive .SET_REGISTERS. For example:
.SET_REGISTERS READ=<R3,R4>, WRITTEN=R5
JSB DO_SOMETHING_USEFUL
In this example, the compiler will assume that R3 and R4 are required inputs
to the routine DO_SOMETHING_USEFUL, and that R5 is overwritten by the
routine. The register usage can be determined by using the input mask of DO_
SOMETHING_USEFUL as the READ qualifier, and the combined output and
scratch masks as the WRITE qualifier.
Note
Using the VAXREGS qualifier without correct register declaration for both
routine entry points and routine calls will produce incorrect code.
4–8 Improving the Performance of Ported Code