This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 4. A = Y + 10; 5. B = X * 4 + 10; 6. Z = 10; 7. if (B < Z) goto 11 1 8. D = Y + A; 9. Z = Z - 1; 10. goto 7; 10. X = X + 1; 12. goto 3; 13. Y = D; 14. halt; 1. Draw the CFG for the code above. Identify the loops in the code. 2. Which statements are loop invariant? Can they be moved outside their enclosing loop? Show the code that results after hoisting any loop invariant code outside the loop. 3. Identify the induction variables in this code. Show the code that results after per-forming any possible strength reduction. 4. Show the code after performing any possible linear test replacement. Loop transformations (II) Consider a machine that does not have a cache . For the following loop transformations, explain whether the transformation would still be worth doing or not. 1. Loop interchange 2. Loop fusion 3. Loop unrolling 2...
View Full Document
This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue.
- Fall '08