

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Professor: Peisert; Class: Compilers; Subject: Engineering Computer Science; University: University of California - Davis; Term: Spring 2009;
Typology: Study Guides, Projects, Research
1 / 41
This page cannot be seen from the preview
Don't miss anything!


































Lecture 25 Dr. Sean Peisert – ECS 142 – Spring 2009 1
Project 4 due June 5, 11:55pm
This Week:
Office Hours Wednesday at 4pm and Friday at 11am
Friday: Register Allocation
Next Week:
Monday: Automatic Memory Management
Wednesday: Static Analysis for Security
Friday: Final Exam Review 2
4
5
7
The correctness condition is not trivial to check
“All paths” includes paths around loops and through branches of conditionals
Checking the condition requires global analysis
An analysis of the entire control-flow graph
Global optimization tasks share several traits:
The optimization depends on knowing a property X at a particular point in program execution
Proving X at any point requires knowledge of the entire method body
It is OK to be conservative. If the optimization requires X to be true, then want to know either
X is definitely true
Don’t know if X is true
It is always safe to say “don’t know” 8
Global Constant Propagation
10
11 value interpretation
this statement never executes c X = constant c
Don’t know if X is a constant
13
Given global constant information, it is easy to perform the optimization
Simply inspect the x = ?associated with a statement using x
If x is constant at that point replace that use of x by the constant
But how do we compute the properties x =?
14
16
17
19
Rules 1-4 relate the out of one statement to the in of the successor statement
they propagate information forward across a CFG edge
Now we need rules relating the in of a statement to the out of the same statement
to propagate information across statements