1 / 13

# Points-to Analysis in Almost Linear Time - PowerPoint PPT Presentation

Points-to Analysis in Almost Linear Time. paper by Bjarne Steensgaard 23rd ACM Symposium on Principles of Programming Languages (POPL'96) Microsoft Research Technical Report MSR-TR-95-08. presented by Jeff Blank CMSC 858Z Spring 2004. Outline of Talk. Background Source Language

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' Points-to Analysis in Almost Linear Time ' - barth

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Points-to Analysis in Almost Linear Time

paper by Bjarne Steensgaard

23rd ACM Symposium on Principles of Programming Languages (POPL'96)

Microsoft Research Technical Report MSR-TR-95-08

presented by Jeff Blank

CMSC 858Z Spring 2004

• Background

• Source Language

• Type System

• Inference Algorithm

• Examples

• Why this paper?

• and which paper, exactly?

• What type of analysis?

• flow-insensitive, context-insensitive, interprocedural

Source Language

fact = fun(x)->(r)

if lessthan(x 1) then

r = 1

else

xminusone = subtract(x 1)

nextfac = fact(xminusone)

r = multiply(x nextfac)

fi

result = fact(10)

S ::= x = y

| x = &y

| x = *y

| x = op(y1. . .yn)

| x = allocate(y)

| *x = y

| x = fun(f1…fn)->(r1…rm) S*

| x1…xm= p(y1…yn)

 ::=  x 

 ::=  | ref()

 ::=  | lam(1…n)(n+1…n+m)

• “obvious” vs. with partial order

• (review on sheet)

_ = whatever!

• imposing the rules = performing points-to analysis

• Algorithm:

• Initialization

• assumptions

• all variables set to different types

• Inference

• impose the rules, i.e. merge types as necessary

• one pass

x,z

b

p

y

c

Example Run

a = &x

b = &y

if p then

y = &z;

else

y = &x

fi

c = &y

i

j

n

More Examplesoriginal algorithm

m = 42

i = m

j = m

j = &n

i

j

n

More Examplesimproved algorithm

m = 42

i = m

j = m

j = &n

i

j

n

More Examplesimproved algorithm (joining with pending set)

m = 42

i = m

j = m

m = &n

• O(N(N,N))

•  is inverse Ackermann’s function, cost of find

• Compared to others...

• no support for separate types in a composite object (e.g. a struct)

• is fast

• even on mid-nineties computers

• test data (show graph)