The University of Queensland Homepage
School of ITEE ITEE Main Website

 Pipe background

Pipeline efficiency

The general idea

Improving efficiency of the pipeline is a target of compiler optimizations. Examples include reordering instructions to remove pipeline stalls resulting from dependent instructions, unrolling loops to increase options for reordering and changing the order of memory operations to minimze cache misses (this one more an issue for the memory project), and renaming registers to remove unnecessary dependences.

Compilers may or may not be effective at making these optimizations. You are required to take an example of your choice, and compare effects of various levels of compiler optimization and hand-tuning the code, e.g., unrolling the loop by hand, or introducing more variables to create the effect of register renaming.

The challenge

Compilers can be quite good at this sort of optimization. You will need to

  • understand assembly language output from the compiler
  • understand the nature of optimizations possible
  • be able to see differences resulting from changes in optimization levels
  • see how to achieve similar effects by modifying the source code
  • find a strategy to measure differences
  • be able to relate what you measure to real problems

It is highly recommended that you use a language reasonably close to machine code, i.e., C for your examples, otherwise it will be hard to see what the compiler is doing.