1 / 12

# Generation of Data-Flow Analyses with DFAGen . - PowerPoint PPT Presentation

Generation of Data-Flow Analyses with DFAGen . Andrew Stone, Michelle Strout , Shweta Behere (Avaya) Colorado State University. 2008 Colorado State Computer Science Research Symposium April 14, 2008. Slide 1. Overview. What is Dataflow analysis? What is DFAGEN?.

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

## PowerPoint Slideshow about ' Generation of Data-Flow Analyses with DFAGen .' - bud

An Image/Link below is provided (as is) to download presentation

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

### Generation of Data-Flow Analyses with DFAGen.

Andrew Stone,

Michelle Strout,

ShwetaBehere (Avaya)

Colorado State University

2008 Colorado State Computer Science Research Symposium

April 14, 2008

Slide 1

What is Dataflow analysis?

What is DFAGEN?

Why someone would want

to use DF analysis

What makes DFAGen unique

Slide 2

There are programs we’d like to

analyze -- but why???

Program Analysis is Useful because these

things are useful:

Optimization

Program Understanding

Debugging

Verification

DF-Analysis is a common way or formulating flow- sensitive analyses

Slide 3

Reaching Defs with

human insight

{}

{S1}

S1: a = 10

{S1}

{S1, S2}

S1 int a = 10

S2 b = c * d

S3 if(cond):

S4 c = 5

else:

S5 b = 6

S6 factorial(a)

S2: b = c*d

{S1, S2}

{S1, S2}

S3: if(cond)

{S1, S2}

{S1, S2, S4}

{S1, S2}

{S2, S5}

S4: c = 5

S5: a = 6

S5: b = 6

(10)

{S1, S2, S4, S5}

{S1, S2, S4, S5}

S6: factorial a

Slide 4

reachingdefs.spec

analysis: ReachingDefs

meet: union

direction: forward

flowtype: stmt

style: may

gen[s]: { s | defs[s] != empty }

kill[s]: { t | defs[t] <= defs[s] }

Slide 5

DFAGen Versus Hand-Written

Manual Version

DFAGenVersion

Writes

OA DF Analysis Framework

.SPEC File

Writes

Passed to

Links To

DFAGen

Links To

C++ Source Code

Generates

C++ Source Code

• You write:

• 7 line SPEC file

• DFAGen Writes:

• 433 lines of C++ code

• You write:

• 402 lines

Slide 6

It’s easy to formulate DF analyses for languages that only have scalars and no pointers and function side effects.

Too bad that rules out most languages

Aliases?!

May or Must?!

Ackkkkkk!!!

Aggregates?!

Side Effects?!

Slide 7

Why DFAGen?

DFAGEN DFAGENDFAGENDFAGENDFAGENDFAGENDFAGENDFAGEN

DFAGEN DFAGENDFAGENDFAGENDFAGENDFAGENDFAGENDFAGEN

Aliases?!

May or Must?!

DFAGen automatically generates pointer, side-effect, and aggregate

Cognizant analyses from succinct, intuitive, specifications.

Ackkkkkk!!!

Aggregates?!

Side Effects?!

Slide 8

What makes DFAGen Unique?

Declarative style specification

AG

Automate may/must issues

Slide 9

int x, y, z;

int *p, *q;

x = rand() % 1000;

y = rand() % 1000;

z = rand() % 1000;

p = &x;

q = &y;

if(*p < *q) {

q = &z;

}

*q = 500;

Must use: {x, y}

May use: {x, y}

Must def: {}

May def: {y, z}

Slide 10

May

reachingdefs.spec

analysis: ReachingDefs

meet: union

direction: forward

flowtype: stmt

style: may

gen[s]: { s | defs[s] !=empty }

kill[s]: { t | defs[t] <= defs[s] }

Must

Slide 11

DFAGen is a tool that makes writing analyses easier.

Program analyses are useful for all sorts of things: optimization, verification, program understanding, etc.

DFAGen is unique because it allows analyses to be written in an intuitive declarative style, and it determines may/must issues for you.

Slide 12