10-practice-quiz2-sol

# 10-practice-quiz2-sol - Massachusetts Institute of...

This preview shows pages 1–4. Sign up to view the full content.

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2006 Practice Quiz 2 and Solutions Saturday, November 4 1. For the basic block: q = 3 r = 10 s = q + r t = 2*r+s t = q u = q + r v = q + t w = 3 + x State for each of the basic blocks on the following page which optimization was performed on the above: Constant Propagation/Folding Copy Propagation Common Subexpression Elimination Dead Code Elimination. 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Name: (a) q = 3 r = 10 s = q + r t1 = s t = 2*r+s t = q u = t1 v = q + t w = 3 + x CSE (b) q = 3 r = 10 s = q + r t = 2*r+s t = q u = q + r v = q + q w = 3 + x Copy Propagation (c) q = 3 r = 10 s = 13 t = 33 t = 3 u = 13 v = 36 w = 3 + x Constant Propagation (d) q = 3 r = 10 s = q + r t = q u = q + r v = q + t w = 3 + x Dead Code Elimination 2
Name: 2. In class we discussed available expression dataflow analysis. Recall that an expression e is available at point p if: Every path from the initial node to p evaluates e before reaching p, and There are no assignments to any operand of e after evaluation but before p .

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ 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