The overall design has two main parts the instruction

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ion combine1 combine2 Page 211 212 Method Abstract -O2 Move vec length Integer + * 31.25 33.25 22.61 21.25 Floating Point + * 31.25 143.00 21.15 135.00 As the table above shows, we eliminate around 10 clock cycles for each vector element with this simple transformation. 5.4. ELIMINATING LOOP INEFFICIENCIES 213 This optimization is an instance of a general class of optimizations known as code motion. They involve identifying a computation that is performed multiple times, (e.g., within a loop), but such that the result of the computation will not change. We can therefore move the computation to an earlier section of the code that does not get evaluated as often. In this case, we moved the call to vec length from within the loop to just before the loop. Optimizing compilers attempt to perform code motion. Unfortunately, as discussed previously, they are typically very cautious about making transformations that change where or how many times a procedure is called. They cannot reliably detect whether or not a function will have side effects, and...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online