{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ps6 - mutual induction variables(h Show the code after...

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

ECE 468 Problem Set 6: CFGs and loop optimizations 1. Consider the following code: 1: a = 7; 2: b = 10; 3: c = 20; L1: 4: if (a <= c) goto L3; 5: d = 3*a; 6: if (d <= c) goto L2; 7: c = b + 11; 8: e = b + 10; L2: 9: a = a + 1; 10: goto L1; L3: 11: //a, b, c, d and e are all live after this (a) What are the basic blocks for this code? (b) Draw the block-level CFG for this code. (c) What are the loop headers? (d) What are the back edges (give the source and target lines of code) (e) What are the loop-invariant instructions in this code? (f) Which instructions can be moved out of the loop? (g) What are the basic induction variables for the loops in this program?
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mutual induction variables? (h) Show the code after applying strength reduction (i) Show the code after applying linear test replacement 2. Cam Piler thinks that loop interchange is always a good idea. Prove him wrong in two ways: (a) Show that loop interchange is not always correct by giving an example of a nested loop where loop interchange is not legal . (b) Describe a situation where loop interchange is legal, but is not actually useful (and may even be harmful). 1...
View Full Document

• Fall '08
• TEST
• Human mitochondrial DNA haplogroup, Compiler optimization, Compiler optimizations, induction variables, Loop Interchange, Cam Piler

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern