Flow insensitivity and imprecision If you ignore flow, then you lose precision. main() { x := &y;... x := &z; } Flow insensitive analysis tells us that.

Slides:



Advertisements
Similar presentations
Defect testing Objectives
Advertisements

School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
Advanced Compiler Techniques LIU Xianhua School of EECS, Peking University Pointer Analysis.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Type-Based Flow Analysis: From Polymorphic Subtyping to CFL-Reachability Jakob Rehof and Manuel Fähndrich Microsoft Research.
Demand-driven Alias Analysis Implementation Based on Open64 Xiaomi An
Flow insensitive pointer analysis: fixed S1: l := new Cons p := l S2: t := new Cons *p := t p := t l p S1 l p tS2 l p S1 t S2 l t S1 p S2 l t S1 p S2 l.
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) Pointer Analysis.
Worst case complexity of Andersen *x = y x abc y def x abc y def Worst case: N 2 per statement, so at least N 3 for the whole program. Andersen is in fact.
Flow-Insensitive Points-to Analysis with Term and Set Constraints Presentation by Kaleem Travis Patrick.
Constraint Systems used in Worst-Case Execution Time Analysis Andreas Ermedahl Dept. of Information Technology Uppsala University.
Discussion #33 Adjacency Matrices. Topics Adjacency matrix for a directed graph Reachability Algorithmic Complexity and Correctness –Big Oh –Proofs of.
Pointer Analysis Lecture 2 G. Ramalingam Microsoft Research, India.
1 Practical Object-sensitive Points-to Analysis for Java Ana Milanova Atanas Rountev Barbara Ryder Rutgers University.
S EMINAL : Searching for ML Type-Error Messages Benjamin Lerner, Dan Grossman, Craig Chambers University of Washington.
Interprocedural analysis © Marcelo d’Amorim 2010.
Next Section: Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis (Wilson & Lam) –Unification.
Context-Sensitive Flow Analysis Using Instantiation Constraints CS 343, Spring 01/02 John Whaley Based on a presentation by Chris Unkel.
Speeding Up Dataflow Analysis Using Flow- Insensitive Pointer Analysis Stephen Adams, Tom Ball, Manuvir Das Sorin Lerner, Mark Seigle Westley Weimer Microsoft.
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.
Range Analysis. Intraprocedural Points-to Analysis Want to compute may-points-to information Lattice:
Pointer Analysis for CASH Compiler Framework Deepak Garg Himanshu Jain Spring 2005.
Intraprocedural Points-to Analysis Flow functions:
From last time S1: l := new Cons p := l S2: t := new Cons *p := t p := t l p S1 l p tS2 l p S1 t S2 l t S1 p S2 l t S1 p S2 l t S1 p L2 l t S1 p S2 l t.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
27-Jun-15 Profiling code, Timing Methods. Optimization Optimization is the process of making a program as fast (or as small) as possible Here’s what the.
ESP [Das et al PLDI 2002] Interface usage rules in documentation –Order of operations, data access –Resource management –Incomplete, wordy, not checked.
Comparison Caller precisionCallee precisionCode bloat Inlining context-insensitive interproc Context sensitive interproc Specialization.
Pointer and Shape Analysis Seminar Mooly Sagiv Schriber 317 Office Hours Thursday
Pointer analysis. Flow insensitive loss of precision S1: l := new Cons p := l S2: t := new Cons *p := t p := t l t S1 p S2 l t S1 p S2 l t S1 p S2 l t.
Pointer analysis. Pointer Analysis Outline: –What is pointer analysis –Intraprocedural pointer analysis –Interprocedural pointer analysis Andersen and.
Procedure Optimizations and Interprocedural Analysis Chapter 15, 19 Mooly Sagiv.
February 2001OASIS --- Norfolk1 Dependence Graphs for Information Assurance Paul Anderson GrammaTech, Inc. Ithaca, NY
P ARALLEL P ROCESSING I NSTITUTE · F UDAN U NIVERSITY 1.
Comparisons Hold up the ‘+’ card if you think the answer is always positive. Hold up the ‘-’ card if you think the answer is always negative. The ?? Card.
Pointer Analysis Lecture 2 G. Ramalingam Microsoft Research, India.
5x 4 – 405 = 5(x 4 – 81) = 5(x 2 + 9)(x 2 – 9) = 5(x 2 + 9)(x + 3)(x – 3) by D. Fisher.
ESEC/FSE-99 1 Data-Flow Analysis of Program Fragments Atanas Rountev 1 Barbara G. Ryder 1 William Landi 2 1 Department of Computer Science, Rutgers University.
Factors, Prime, Composite Greatest Common Factor Simplifying Fractions
Pointer Analysis Survey. Rupesh Nasre. Aug 24, 2007.
Pointer Analysis Lecture 2 G. Ramalingam Microsoft Research, India & K. V. Raghavan.
Breadth First Search and Depth First Search. Greatest problem in Computer Science Has lead to a lot of new ideas and data structures Search engines before.
Pointer Analysis. Rupesh Nasre. Advisor: Prof R Govindarajan. Apr 05, 2008.
Pointer Analysis – Part I CS Pointer Analysis Answers which pointers can point to which memory locations at run-time Central to many program optimization.
Department of Electronic & Electrical Engineering Statements Blocks{} Semicolons ; Variables Names keywords Scope.
1PLDI 2000 Off-line Variable Substitution for Scaling Points-to Analysis Atanas (Nasko) Rountev PROLANGS Group Rutgers University Satish Chandra Bell Labs.
Pointer Analysis CS Alias Analysis  Aliases: two expressions that denote the same memory location.  Aliases are introduced by:  pointers  call-by-reference.
 1) -5+6  2) 7+ (-8)  3)  4) 8(-3)  5) -9(2)  6) 18/2  7 (-9)/3 1 Algebra II.
Inter-procedural analysis
Manuel Fahndrich Jakob Rehof Manuvir Das
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Warm UP.
ML Again ( Chapter 7) Patterns Local variable definitions
3.1 Factors and Multiples of Whole Numbers (Outcome FP10.1)
Pointer Analysis Lecture 2
Structural testing, Path Testing
Interprocedural Analysis Chapter 19
'. \s\s I. '.. '... · \ \ \,, I.
Semantics In Text: Chapter 3.
Pointer Analysis Lecture 2
' '· \ ·' ,,,,
Transformations Day 2: Composition.
Pointer analysis.
Module 2-3: Passing pointers
ALGEBRA I - SECTION 7-2 (Multiplying Powers With the Same Base)
Pointer Analysis Jeff Da Silva Sept 20, 2004 CARG.
Space groups Start w/ 2s and 21s 222.
I can tell the products of 6’s facts
Pointer analysis John Rollinson & Kaiyuan Li
Presentation transcript:

Flow insensitivity and imprecision If you ignore flow, then you lose precision. main() { x := &y;... x := &z; } Flow insensitive analysis tells us that x may point to z here! But, insensitivity may alleviate two bottlenecks: (1) space : mem exhausted by large programs (2) time : need speed for JIT or edit, compile loop

Andersen’s : worst case complexity *x = y x abc y def x abc y def Worst case: N 2 per statement at least N 3 for the whole program Andersen’s is in fact O(N 3 )

New idea: one successor per node Each node can point to at most one “thing”. “Thing” : everything a var may point to. x a,b,c y d,e,f *x = y x a,b,c y d,e,f

x *x = y y More general case for *x = y

x *x = y yxy More general case for *x = y

x *x = y yxyxy More general case for *x = y

x x = *y y Handling: x = *y More general case for x = *y

x x = *y yxy Handling: x = *y More general case for x = *y

x x = *y yxyxy Handling: x = *y More general case for x = *y

x x = y y Handling: x = y More general case for x = y

x x = y yxy Handling: x = y More general case for x = y

x x = y yxyxy Handling: x = y More general case for x = y

x x = y yxyxy Handling: x = y (what about y = x?) More general case for x = y

x x = y yxyxy Handling: x = y (what about y = x?) same result for y = x ! More general case for x = y

x = &y xy Handling: x = &y More general case for x = &y

x = &y xyxy Handling: x = &y More general case for x = &y

x = &y xyx y,… xy Handling: x = &y More general case for x = &y

Our favorite example, once more! S1: l := new Cons p := l S2: t := new Cons *p := t p := t

Our favorite example, once more! S1: l := new Cons p := l S2: t := new Cons *p := t p := t l S1 t S2 p l S1 l p l t S2 p l S1,S2 tp l S1 t S2 p 4 5

Flow insensitive loss of precision S1: l := new Cons p := l S2: t := new Cons *p := t p := t l t S1 p S2 l t S1 p S2 l t S1 p S2 l t S1 p S2 Flow-sensitive Subset-based Flow-insensitive Subset-based l t S1 p S2 l S1,S2 tp Flow-insensitive Unification- based

bar() { i := &a; j := &b; foo(&i); foo(&j); // i pnts to what? *i :=...; } void foo(int* p) { printf(“%d”,*p); } Another example

bar() { i := &a; j := &b; foo(&i); foo(&j); // i pnts to what? *i :=...; } void foo(int* p) { printf(“%d”,*p); } i a j b p i a i a j b i a j b p i,j a,b p Another example 4 3

Steensgaard and beyond Well engineered implementation of Steensgaard: 2.1 MLOC in 1 minute (Word97) One Level Flow (Das PLDI 00) extension to Steensgaard achieves higher precision 2.1 MLOC in 2 minutes (Word 97)