Approximation
Want to show:
Quick recap of abstract interpretation
Cousot and Cousot 77
Cousot and Cousot show that the following conditions are sufficient for proving (1) and (2):
(3)
Let's look at the condition
(4)
(5)
Let's look at the c

Compilers have many bugs
Automatically Checking the Correctness of Program Analyses and Transformations
Searched for "incorrect" and "wrong" in the gccbugs mailing list. Some of the results:
[Bug middle-end/19650] New: miscompilation of corr

From last class
The above is Click's solution (PLDI 95)
The above is Click's solution (PLDI 95)
Control Dependences
A node (basic block) Y is control-dependent on another X iff X determines whether Y executes
there exists a path from X to Y s.t.

Next Section: Pointer Analysis
Outline:
What is pointer analysis Intraprocedural pointer analysis Interprocedural pointer analysis (Wilson & Lam) Unification based interprocedural pointer analysis (Steensgaard)
Pointer and Alias Analysis
Alias

Until now
We've seen how to define dataflow analyses How do we know our analyses are correct?
Correctness
We could reason about each individual analysis one a time However, a unified framework would make proofs easier to develop and understand

CSE 231: Advanced Compilers
CSE 231: Advanced Compilers Fall Quarter, 2006
General information
Meeting times and location: T-Th 5:00-6:20, location: WLH 2207 Instructor: Sorin Lerner (email: lerner at cs, Office hours: by appointment, email m

Administrative info
Subscribe to the class mailing list
instructions are on the class web page, which is accessible from my home page, which is accessible by searching for Sorin Lerner on google
Tour of common optimizations
Project page is up
N

From last lecture
We want to find a fixed point of F, that is to say a map m such that m = F(m) Define , which is = e. lifted to be a map:
From last lecture
If F is monotonic and height of lattice is finite: iterative algorithm terminates If F

From last class: CSE
Want to compute when an expression is available in a var Domain:
Flow functions
in
X := Y op Z
out
FX := Y op Z(in) =
in
X := Y
out
FX := Y(in) =
Flow functions
Example
in
X := Y op Z
out
FX := Y op Z(in) = in { X

Approach #1 to context-sensitivity
Keep information for different call sites separate
Example again
main() { g(); f(); lock; unlock; } main f() { g() { g(); if(isLocked() { if (.) { main(); } unlock; } } else { lock; } } f g
In this case: context

! "
true x := 11; if (x = 11) { DoSomething(); } else { DoSomethingElse(); x := x + 1; } y := x; / value of y?
x := 11; DoSomething(); y := x; / value of y?
x := 11; DoSomething(); y := 11;
x := 11; do { if (x = 11) { DoSomething(); } else { DoSo

Final exam week
Three things on finals week:
final exam final project presentations final project report
Program analysis and Software Reliability
Software reliability: issues
What are the issues?
Software reliability: issues
What is softwar

Let's look at a compiler
Advanced Compilers
CSE 231 Instructor: Sorin Lerner
Compiler
if (.) { x := .; } else { Parser y := .; } .;
Optimizer Compiler
Code Exec Gen
Let's look at a compiler
Compiler
Parser Optimizer Code Gen
Advanced Optimizer

Representing programs
Goals
Representing programs
Primary goals
analysis is easy and effective
just a few cases to handle directly link related things
transformations are easy to perform general, across input languages and target machines

Inlining pros and cons (discussion)
Inlining pros and cons
Pros
eliminate overhead of call/return sequence eliminate overhead of passing args & returning results can optimize callee in context of caller and vice versa
Cons
can increase compil

Interprocedural pointer analysis for C
We'll look at Wilson & Lam PLDI 95, and focus on two problems solved by this paper:
how to represent pointer information in the presence of casts, pointer arithmetic, unions, and all the rest of C. how to per

Administrative info
Subscribe to the class mailing list!
instructions are on the class web page, which is accessible from my home page, which is accessible by searching for Sorin Lerner on google
From last lecture
Flow functions: Given informatio