HPlogo Getting Started as an MPE/iX Programmer Programmer's Guide: HP 3000 Computer MPE/iX Computer Systems > Chapter 5 Optimizing a Program

Optimizer Levels

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The levels of code optimization that the MPE/iX Optimizer provides are Level 0, Level 1, and Level 2.

Level 0 optimization is the default optimization level and provides simple optimizations that minimize compile time. Use this level when debugging a program or running a program that will not be run many times (for example, a student job program that is run a few times and discarded). Level 0 functions include:

  • Simple branch delay slot scheduling.

  • Dead code elimination.

  • Faster register allocation (including copy elimination).

Level 1 optimization is local to basic blocks, but does not optimize globally. Use Level 1 to achieve some optimization without spending excessive time compiling. Level 1 functions include:

  • Branch optimization.

  • Dead code elimination.

  • Faster register allocation (including copy elimination).

  • Instruction scheduling.

  • Peephole optimization.

Level 2 optimization is global optimization. It provides the greatest saving of space and time achievable with the Optimizer and produces the most compact and fastest running program of all the levels. Use Level 2 when running a debugged program a large number of times. This is the correct level to choose for most applications. Level 2 functions are:

  • All Level 1 optimizations.

  • Coloring register allocation.

  • Induction variable elaboration and strength reduction. (An induction variable is a variable dependent on the value of a loop counter.)

  • Common subexpression elimination.

  • Constant folding.

  • Loop invariant code motion.

  • Unused definition elimination.

  • Promotion of variables to registers.

Feedback to webmaster