1 / 12

Generation of Data-Flow Analyses with DFAGen .

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?.

bud
Download Presentation

Generation of Data-Flow Analyses with DFAGen .

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. Overview What is Dataflow analysis? What is DFAGEN? Why someone would want to use DF analysis What makes DFAGen unique Slide 2

  3. Why Data-Flow Analysis? 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

  4. 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

  5. Reaching Definitions 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

  6. 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

  7. Why DF Analysis is Hard To Implement: 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

  8. 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

  9. What makes DFAGen Unique? Declarative style specification AG Automate may/must issues Slide 9

  10. May or Must 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

  11. So is it May or Must? 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

  12. Conclusions 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

More Related