573finalsol

573finalsol - ECE 573 – Final Exam Name Purdue Email...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: ECE 573 – Final Exam December 14, 2009 Name: Purdue Email: Please sign the following: I affirm that the answers given on this test are mine and mine alone. I did not receive help from any person or material (other than those explicitly allowed). X Part 1: /30 Part 2: /30 Part 3: /15 Part 4: /25 Total: /100 Part 1: Dataflow analysis (30 pts) In this problem, you will design a dataflow analysis that performs a sign analysis . A sign analysis determines at each program point whether a variable is definitely positive (+), definitely negative (- ), definitely zero (0), or could be anything (?). Problem 1 (10 pts): Provide a lattice for this dataflow analysis. A few things to keep in mind: (i) don’t forget that having no information is different from a variable being “anything”; (ii) if a variable is 0, it also counts as both + and- ; (iii) ? means that a variable might be positive or might be negative. ⊥ – + ? The lattice for this analysis is given above. Note that is below + and- , because it counts as both. If we merge information coming from two branches, with one saying that x is and the other saying that x is- , we want the result to be- . Problem 2 (1 pts): Should this analysis be forward or backward? This is very similar to a constant propagation analysis; we want it to be forward. Whether a variable is + or- depends on what has happened to the variable in the past . Problem 3 (1 pts): Does this analysis use meet or join at merge points? We should use join (think about the discussion of merging in the lattice solution). Problem 4: For each statement, define the transfer function. Each subproblem shows one or more tables (except part (D)). The column headers give the value of y in and the row headers (if the exist) give the value of...
View Full Document

Page1 / 10

573finalsol - ECE 573 – Final Exam Name Purdue Email...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online