Content

  1. Basic Blocks
    1. Local Optimizations
    2. Register Allocation
    3. Object Code Optimizations

Basic Blocks

A segment of code that must enter at beginning and exits only at end.

  • Local optimizations
  • Optimizations accross BBs

Local Optimizations

  • Constant folding
  • Constant propagation
  • Algebraic simplification & reassociation
  • Operator strength reduction
  • Copy propagation
  • Dead code elimination/remove unreachable code
  • Common subexpression elimination
  • Code motion: move statements evaluating to the same value in every iteration outside of loop
  • Remove redundant jumps
  • Branch chaining

Register Allocation

k-coloring graph problem.

Object Code Optimizations

  • Instruction scheduling
  • Redundant load & stores

results matching ""

    No results matching ""