Download HP Pascal for OpenVMS User Manual
Transcript
The compiler performs the following optimizations: • Compile-time evaluation of constant expressions • Elimination of some common subexpressions • Partial elimination of unreachable code • Code hoisting from structured statements, including the removal of invariant computations from loops • Inline code expansion for many predeclared functions • Inline code expansion for user-declared routines • Rearrangement of unary minus and NOT operations to eliminate unary negation and complement operations • Partial evaluation of logical expressions • Propagation of compile-time known values • Strength reduction (OpenVMS I64 and OpenVMS Alpha systems) • Split lifetime analysis (OpenVMS I64 and OpenVMS Alpha systems) • Code scheduling (OpenVMS I64 and OpenVMS Alpha systems) • Loop unrolling (OpenVMS I64 and OpenVMS Alpha systems) • Software pipelining (OpenVMS I64 and OpenVMS Alpha systems) These optimizations are described in the following sections. In addition, the compiler performs the following optimizations, which can be detected only by a careful examination of the machine code produced by the compiler: • Global assignment of variables to registers If possible, reduce the number of memory references needed by assigning frequently referenced variables to registers. • Reordering the evaluation of expressions This minimizes the number of temporary values required. • Peephole optimization of instruction sequences The compiler examines code a few instructions at a time to find operations that can be replaced by shorter and faster equivalent operations. For More Information: • On HP Pascal language elements (HP Pascal for OpenVMS Language Reference Manual) 3–2 Program Correctness, Optimization, and Efficiency