SlideShare a Scribd company logo
1 of 111
Download to read offline
Demand-Driven Computation of
Inter-procedural Data Flow
Evelyn Duesterwald et al. POPL 1995
Presenter: Min-Yih Hsu
Outline
• Overview
• Illustrating Exhaustive Data-Flow Analysis with Copy Constant
Propagation (CCP)
• Demand-Driven Data-Flow Analysis
• Related Works
• Comments
Overview
The over-analysis problem
The over-analysis problem
• Users of a data-flow analysis might only need part of the results.
• Generating superfluous analysis results are called over-analysis.
The over-analysis problem
• Users of a data-flow analysis might only need part of the results.
• Generating superfluous analysis results are called over-analysis.
• Example: In constant propagation, user only asked the constant
value (or non-constant) of variable x at line n.
The over-analysis problem
• Users of a data-flow analysis might only need part of the results.
• Generating superfluous analysis results are called over-analysis.
• Example: In constant propagation, user only asked the constant
value (or non-constant) of variable x at line n.
• Traditional data-flow analysis will give you results of every
variables in each line.
The over-analysis problem
• Users of a data-flow analysis might only need part of the results.
• Generating superfluous analysis results are called over-analysis.
• Example: In constant propagation, user only asked the constant
value (or non-constant) of variable x at line n.
• Traditional data-flow analysis will give you results of every
variables in each line.
• A real-world application: Interactive code editor
CFG
Untouched
Analyzed
Traditional Approach
CFG
Untouched
Analyzed
Traditional Approach
CFG
Untouched
Analyzed
Traditional Approach
CFG
Variable Constant
X C1
Y C2
Z C3
At Line n:
Untouched
Analyzed
Traditional Approach
CFG
Variable Constant
X C1
Y C2
Z C3
At Line n:
Untouched
Analyzed
Traditional Approach
a.k.a Exhaustive Approach
CFG
Untouched
Analyzed
Demand-Driven Approach
CFG
Untouched
Analyzed
Demand-Driven Approach
CFG
Untouched
Analyzed
Demand-Driven Approach
CFG
Variable Constant
X -
Y C2
Z -
At Line n:
Untouched
Analyzed
Demand-Driven Approach
CFG
Variable Constant
X -
Y C2
Z -
At Line n:
Untouched
Analyzed
Demand-Driven Approach
Query:
q=<Fy, n>
CFG
Variable Constant
X -
Y C2
Z -
At Line n:
Untouched
Analyzed
Demand-Driven Approach
Query:
q=<Fy, n>
CFG
Variable Constant
X -
Y C2
Z -
At Line n:
Untouched
Analyzed
Demand-Driven Approach
Query:
q=<Fy, n>
Illustrating Exhaustive Data-Flow Analysis
w/ Copy Constant Propagation (CCP)
Copy Constant Propagation (CCP)
A lattice L
Copy Constant Propagation (CCP)
A lattice L Data flow facts at a given program point
x is a k-tuple of type L. (denoted Lk)
(x)v means data flow fact for variable v
Copy Constant Propagation (CCP)
A lattice L Data flow facts at a given program point
x is a k-tuple of type L. (denoted Lk)
(x)v means data flow fact for variable v
If variable v has constant c :
Copy Constant Propagation (CCP)
The local (intra-procedural) flow function
Copy Constant Propagation (CCP)
The local (intra-procedural) flow function
Copy Constant Propagation (CCP)
The local (intra-procedural) flow function
Copy Constant Propagation (CCP)
Inter-procedural related formulas
Copy Constant Propagation (CCP)
Inter-procedural related formulas
Inter-procedural data-flow functions
Copy Constant Propagation (CCP)
Inter-procedural related formulas
Inter-procedural data-flow functions
Copy Constant Propagation (CCP)
Inter-procedural related formulas
Inter-procedural data-flow functions
Copy Constant Propagation (CCP)
Inter-procedural related formulas
Inter-procedural data-flow functions
Inter-procedural data-flow results
On program point n
Demand-Driven Data-Flow Analysis
CFG
Variable Constant
X -
Y C2
Z -
At Line n:
Untouched
Analyzed
Demand-Driven Approach
Query:
q=<Fy, n>
CFG
Variable Constant
X -
Y C2
Z -
At Line n:
Untouched
Analyzed
Demand-Driven Approach
Query:
q=<Fy, n>
Query (i.e. the “Demand”)
q := <y, n>
Query (i.e. the “Demand”)
q := <y, n>
• y is a set of data flow facts
Query (i.e. the “Demand”)
q := <y, n>
• y is a set of data flow facts
• n is a program point
Query (i.e. the “Demand”)
q := <y, n>
• y is a set of data flow facts
• n is a program point
• q is a boolean type result
Query (i.e. the “Demand”)
q := <y, n>
• y is a set of data flow facts
• n is a program point
• q is a boolean type result
q tells if y is a safe approximation of the exhaustive data flow facts
on program point n.
An Example Query in CCP*
q := <[a=c], 10>
“Tell me if variable a is equal to constant c at line 10”
Resolving Queries
CFG
Untouched
Analyzed
q=<y, n>
Resolving Queries
CFG
Untouched
Analyzed
q=<y, n>
Resolving Queries
CFG
Untouched
Analyzed
q=<y, n>
Resolving Queries
CFG
Untouched
Analyzed
q=<y, n>
Resolving Queries
CFG
Untouched
Analyzed
q=<y, n>
Find the answer along this path
Resolving Queries
CFG
Untouched
Analyzed
q=<y, n>
Key Idea: Reversed Flow Function!
Find the answer along this path
Reverse Flow Function
Reverse Flow Function
If f is meet-distributive…
Reverse Flow Function
If f is meet-distributive…
(It’s easy to show that) fr will be join-distributive!
Reverse Flow Function
If f is meet-distributive…
(It’s easy to show that) fr will be join-distributive!
=> We can use MFP with reversed functions
along the reversed path!
Reverse Flow Function
What does answers?
Reverse Flow Function
What does answers?
Node n
Reverse Flow Function
What does answers?
Node n
What input should I feed in…
Reverse Flow Function
What does answers?
Node n
What input should I feed in…
In order to see w=c here?
Reverse Flow Function
What does answers?
Node n
What input should I feed in…
In order to see w=c here?
Reverse Flow Function
What does answers?
Node n
What input should I feed in…
In order to see w=c here?
Any Integer!
Reverse Flow Function
What does answers?
Node n
What input should I feed in…
In order to see w=c here?
Impossible
Any Integer!
Reverse Flow Function
What does answers?
Node n
What input should I feed in…
In order to see w=c here?
Impossible
Any Integer!
Asking u=c instead
Inter-procedural Reverse Flow Function
Additional Function Compositions Properties
Inter-procedural Reverse Flow Function
Additional Function Compositions Properties
+
Inter-procedural Reverse Flow Function
Additional Function Compositions Properties
+
=
Reverse Flow Function - Combining Everything
Reverse Flow Function - Combining Everything
Inter and Intra-procedural data-flow function
Reverse Flow Function - Combining Everything
Inter and Intra-procedural data-flow function
Generalizing the CCP Query
q := <[a=c], 10>
“Tell me if variable a is equal to constant c at line 10”
Generalizing the CCP Query
q := <[a=c], 10>
“Tell me if variable a is equal to constant c at line 10”
What c should we ask?
Generalizing the CCP Query
q := <[a=c], 10>
“Tell me if variable a is equal to constant c at line 10”
What c should we ask?
A more useful query:
“Tell me the constant value (if it is) of variable a at line 10.”
q’ := <[a], 10>
Generalized CCP Query - New Reverse Flow Function
Generalized CCP Query - New Reverse Flow Function
Generalized CCP Query - New Reverse Flow Function
Also need to collect the constant value!
Generalized CCP Query - A Simple Example
x = 3
y = 4
a = x
r = a + 1 <[a], n>
Generalized CCP Query - A Simple Example
x = 3
y = 4
a = x
r = a + 1 <[a], n>
Generalized CCP Query - A Simple Example
x = 3
y = 4
a = x
r = a + 1 <[a], n>
Final answer for this query
Generalized CCP Query - A Simple Example
x = 3
y = 4
a = x
r = a + 1 <[a], n>
Final answer for this query
Generalized CCP Query - A Simple Example
x = 3
y = 4
a = x
r = a + 1 <[a], n>
Final answer for this query
Takeaways
Takeaways
• Reverse flow function is the core of this algorithm.
• It’s join-distributive property allow us to use MFP with it.
Takeaways
• Reverse flow function is the core of this algorithm.
• It’s join-distributive property allow us to use MFP with it.
• In the generalized query (for CCP):
Takeaways
• Reverse flow function is the core of this algorithm.
• It’s join-distributive property allow us to use MFP with it.
• In the generalized query (for CCP):
• Instead of taking its returned value from reverse functions as
the query result, we used it to guide the query propagation
process.
Time and Space Complexity
• The same worst-case complexities as Sharir and Pnueli’s
exhaustive (iterative worklist-based) data-flow analysis*.
• Running Time: O(C x height(L) x |L| x |N|)
• C is the maximum number of call sites, and N is the number of
nodes.
• Space: O(|L| x |N|)
*Sharir, Micha, and Amir Pnueli. Two approaches to interprocedural data flow analysis. New York
University. Courant Institute of Mathematical Sciences. ComputerScience Department, 1978.
Related Works
• Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow
analysis algorithms." ACM Transactions on Programming Languages
and Systems (TOPLAS) 10.1 (1988): 1-50.
• Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow
analysis algorithms." ACM Transactions on Programming Languages
and Systems (TOPLAS) 10.1 (1988): 1-50.
• Incremental data-flow analysis need to perform full data-flow
analysis on first run. Where over-analysis problem might still
happen.
• Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow
analysis algorithms." ACM Transactions on Programming Languages
and Systems (TOPLAS) 10.1 (1988): 1-50.
• Incremental data-flow analysis need to perform full data-flow
analysis on first run. Where over-analysis problem might still
happen.
• IFDS / IDE
• Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow
analysis algorithms." ACM Transactions on Programming Languages
and Systems (TOPLAS) 10.1 (1988): 1-50.
• Incremental data-flow analysis need to perform full data-flow
analysis on first run. Where over-analysis problem might still
happen.
• IFDS / IDE
• The authors of this paper argued that their work has “less
restrictions on structure of lattice and flow functions”.
• Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow
analysis algorithms." ACM Transactions on Programming Languages
and Systems (TOPLAS) 10.1 (1988): 1-50.
• Incremental data-flow analysis need to perform full data-flow
analysis on first run. Where over-analysis problem might still
happen.
• IFDS / IDE
• The authors of this paper argued that their work has “less
restrictions on structure of lattice and flow functions”.
• e.g. This work can give an approximation even with non-
distributive flow function.
• (IFDS / IDE cont’d)
• (IFDS / IDE cont’d)
• IFDS and IDE can not (fully) avoid over-analysis problem.
• (IFDS / IDE cont’d)
• IFDS and IDE can not (fully) avoid over-analysis problem.
• e.g. For CCP problem, IFDS / IDE would tell the constant value
(if any) for every variables.
• (IFDS / IDE cont’d)
• IFDS and IDE can not (fully) avoid over-analysis problem.
• e.g. For CCP problem, IFDS / IDE would tell the constant value
(if any) for every variables.
• Strom, Robert E., and Daniel M. Yellin. "Extending typestate
checking using conditional liveness analysis." IEEE Transactions on
Software Engineering 19.5 (1993): 478-485.
• (IFDS / IDE cont’d)
• IFDS and IDE can not (fully) avoid over-analysis problem.
• e.g. For CCP problem, IFDS / IDE would tell the constant value
(if any) for every variables.
• Strom, Robert E., and Daniel M. Yellin. "Extending typestate
checking using conditional liveness analysis." IEEE Transactions on
Software Engineering 19.5 (1993): 478-485.
• Also used the idea of backward and demand-driven program
analysis.
Comments
What I Think the Paper Should Organize
(Larger Box == More Important)
The “Normal” Data-Flow Analysis
Demand-Driven Data-Flow Analysis
w/ Boolean Query Result
Generalize To Non-Boolean Query Result
(for CCP)
Supporting Global Variables /
Memory Aliasing
The Paper’s Organization
(Larger Box == More Paragraphs)
The “Normal” Data-Flow Analysis
The Paper’s Organization
(Larger Box == More Paragraphs)
The “Normal” Data-Flow Analysis
Demand-Driven Data-Flow Analysis
w/ Boolean Query Result
The Paper’s Organization
(Larger Box == More Paragraphs)
The “Normal” Data-Flow Analysis
Supporting Global Variables /
Memory Aliasing
Demand-Driven Data-Flow Analysis
w/ Boolean Query Result
The Paper’s Organization
(Larger Box == More Paragraphs)
The “Normal” Data-Flow Analysis
Generalize To Non-Boolean Query Result (for CCP)
Supporting Global Variables /
Memory Aliasing
Demand-Driven Data-Flow Analysis
w/ Boolean Query Result
The Paper’s Organization
(Larger Box == More Paragraphs)
The “Normal” Data-Flow Analysis
Generalize To Non-Boolean Query Result (for CCP)
Supporting Global Variables /
Memory Aliasing
Demand-Driven Data-Flow Analysis
w/ Boolean Query Result
Other Comments
Other Comments
• The querying mechanism fit really well in Language Server
Protocol (LSP), which is getting more attention now.
Other Comments
• The querying mechanism fit really well in Language Server
Protocol (LSP), which is getting more attention now.
• This paper did a pretty nice survey on related works.
Other Comments
• The querying mechanism fit really well in Language Server
Protocol (LSP), which is getting more attention now.
• This paper did a pretty nice survey on related works.
• Some notations are inconsistent across paragraphs.
Other Comments
• The querying mechanism fit really well in Language Server
Protocol (LSP), which is getting more attention now.
• This paper did a pretty nice survey on related works.
• Some notations are inconsistent across paragraphs.
• Amortized Time Complexity Analysis Please!!!
Summary
Summary
• This work used queries to drive the data-flow analysis process to avoid
generating redundant results that would never be used.
Summary
• This work used queries to drive the data-flow analysis process to avoid
generating redundant results that would never be used.
• The algorithm performed a revered data-flow analysis from the point
where users are inquiring.
• The reverse data-flow function played an important role.
Summary
• This work used queries to drive the data-flow analysis process to avoid
generating redundant results that would never be used.
• The algorithm performed a revered data-flow analysis from the point
where users are inquiring.
• The reverse data-flow function played an important role.
• The query algorithm was augmented to support arbitrary result types.
In addition to the basic boolean type.
Summary
• This work used queries to drive the data-flow analysis process to avoid
generating redundant results that would never be used.
• The algorithm performed a revered data-flow analysis from the point
where users are inquiring.
• The reverse data-flow function played an important role.
• The query algorithm was augmented to support arbitrary result types.
In addition to the basic boolean type.
• Regarding the time complexity, this algorithm is no worse than the
exhaustive data-flow analysis.
• Just as the incremental data-flow analysis, we hope to see the
amortized time complexity.

More Related Content

Similar to Demand-Driven Interprocedural Data Flow Analysis

Streaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event ProcessingStreaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event ProcessingIstván Dávid
 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisEelco Visser
 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksEelco Visser
 
Slides for "Do Deep Generative Models Know What They Don't know?"
Slides for "Do Deep Generative Models Know What They Don't know?"Slides for "Do Deep Generative Models Know What They Don't know?"
Slides for "Do Deep Generative Models Know What They Don't know?"Julius Hietala
 
Scalable Recommendation Algorithms with LSH
Scalable Recommendation Algorithms with LSHScalable Recommendation Algorithms with LSH
Scalable Recommendation Algorithms with LSHMaruf Aytekin
 
HOP-Rec_RecSys18
HOP-Rec_RecSys18HOP-Rec_RecSys18
HOP-Rec_RecSys18Matt Yang
 
Change Impact Analysis for Natural Language Requirements
Change Impact Analysis for Natural Language RequirementsChange Impact Analysis for Natural Language Requirements
Change Impact Analysis for Natural Language RequirementsLionel Briand
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewDesign and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewWaqas Nawaz
 
closing-the-hardware-design-loop-with-multisim-a-case-study
closing-the-hardware-design-loop-with-multisim-a-case-studyclosing-the-hardware-design-loop-with-multisim-a-case-study
closing-the-hardware-design-loop-with-multisim-a-case-studyAyush Bhardwaj
 
Computational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in RComputational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in Rherbps10
 
Adaptive Parallelization of Queries over Dependent Web Service Calls
Adaptive Parallelization of Queries over Dependent Web Service CallsAdaptive Parallelization of Queries over Dependent Web Service Calls
Adaptive Parallelization of Queries over Dependent Web Service CallsSabesan Manivasakan
 
Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...ANIRBANMAJUMDAR18
 
Presentation iswc
Presentation iswcPresentation iswc
Presentation iswcSydGillani
 
clique-summary
clique-summaryclique-summary
clique-summaryJia Wang
 

Similar to Demand-Driven Interprocedural Data Flow Analysis (20)

Streaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event ProcessingStreaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event Processing
 
TINET_FRnOG_2008_public
TINET_FRnOG_2008_publicTINET_FRnOG_2008_public
TINET_FRnOG_2008_public
 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow Analysis
 
Crv
CrvCrv
Crv
 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone Frameworks
 
Slides for "Do Deep Generative Models Know What They Don't know?"
Slides for "Do Deep Generative Models Know What They Don't know?"Slides for "Do Deep Generative Models Know What They Don't know?"
Slides for "Do Deep Generative Models Know What They Don't know?"
 
Scalable Recommendation Algorithms with LSH
Scalable Recommendation Algorithms with LSHScalable Recommendation Algorithms with LSH
Scalable Recommendation Algorithms with LSH
 
HOP-Rec_RecSys18
HOP-Rec_RecSys18HOP-Rec_RecSys18
HOP-Rec_RecSys18
 
Change Impact Analysis for Natural Language Requirements
Change Impact Analysis for Natural Language RequirementsChange Impact Analysis for Natural Language Requirements
Change Impact Analysis for Natural Language Requirements
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewDesign and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract View
 
closing-the-hardware-design-loop-with-multisim-a-case-study
closing-the-hardware-design-loop-with-multisim-a-case-studyclosing-the-hardware-design-loop-with-multisim-a-case-study
closing-the-hardware-design-loop-with-multisim-a-case-study
 
PS
PSPS
PS
 
Computational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in RComputational Techniques for the Statistical Analysis of Big Data in R
Computational Techniques for the Statistical Analysis of Big Data in R
 
Adaptive Parallelization of Queries over Dependent Web Service Calls
Adaptive Parallelization of Queries over Dependent Web Service CallsAdaptive Parallelization of Queries over Dependent Web Service Calls
Adaptive Parallelization of Queries over Dependent Web Service Calls
 
Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...
 
Presentation iswc
Presentation iswcPresentation iswc
Presentation iswc
 
clique-summary
clique-summaryclique-summary
clique-summary
 
CS-323 DAA.pdf
CS-323 DAA.pdfCS-323 DAA.pdf
CS-323 DAA.pdf
 
3 recursion
3 recursion3 recursion
3 recursion
 
3-Recursion.ppt
3-Recursion.ppt3-Recursion.ppt
3-Recursion.ppt
 

More from Min-Yih Hsu

Debug Information And Where They Come From
Debug Information And Where They Come FromDebug Information And Where They Come From
Debug Information And Where They Come FromMin-Yih Hsu
 
MCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
MCA Daemon: Hybrid Throughput Analysis Beyond Basic BlocksMCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
MCA Daemon: Hybrid Throughput Analysis Beyond Basic BlocksMin-Yih Hsu
 
Handling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVMHandling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVMMin-Yih Hsu
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backendMin-Yih Hsu
 
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[COSCUP 2021] LLVM Project: The Good, The Bad, and The UglyMin-Yih Hsu
 
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...Min-Yih Hsu
 
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et alPaper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et alMin-Yih Hsu
 
Souper-Charging Peepholes with Target Machine Info
Souper-Charging Peepholes with Target Machine InfoSouper-Charging Peepholes with Target Machine Info
Souper-Charging Peepholes with Target Machine InfoMin-Yih Hsu
 
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern CompilersMin-Yih Hsu
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCLMin-Yih Hsu
 
Trace Scheduling
Trace SchedulingTrace Scheduling
Trace SchedulingMin-Yih Hsu
 
Polymer Start-Up (SITCON 2016)
Polymer Start-Up (SITCON 2016)Polymer Start-Up (SITCON 2016)
Polymer Start-Up (SITCON 2016)Min-Yih Hsu
 
War of Native Speed on Web (SITCON2016)
War of Native Speed on Web (SITCON2016)War of Native Speed on Web (SITCON2016)
War of Native Speed on Web (SITCON2016)Min-Yih Hsu
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSPMin-Yih Hsu
 

More from Min-Yih Hsu (14)

Debug Information And Where They Come From
Debug Information And Where They Come FromDebug Information And Where They Come From
Debug Information And Where They Come From
 
MCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
MCA Daemon: Hybrid Throughput Analysis Beyond Basic BlocksMCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
MCA Daemon: Hybrid Throughput Analysis Beyond Basic Blocks
 
Handling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVMHandling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVM
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
 
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
[COSCUP 2021] LLVM Project: The Good, The Bad, and The Ugly
 
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
[TGSA Academic Friday] How To Train Your Dragon - Intro to Modern Compiler Te...
 
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et alPaper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
Paper Study - Incremental Data-Flow Analysis Algorithms by Ryder et al
 
Souper-Charging Peepholes with Target Machine Info
Souper-Charging Peepholes with Target Machine InfoSouper-Charging Peepholes with Target Machine Info
Souper-Charging Peepholes with Target Machine Info
 
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern Compilers
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCL
 
Trace Scheduling
Trace SchedulingTrace Scheduling
Trace Scheduling
 
Polymer Start-Up (SITCON 2016)
Polymer Start-Up (SITCON 2016)Polymer Start-Up (SITCON 2016)
Polymer Start-Up (SITCON 2016)
 
War of Native Speed on Web (SITCON2016)
War of Native Speed on Web (SITCON2016)War of Native Speed on Web (SITCON2016)
War of Native Speed on Web (SITCON2016)
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Demand-Driven Interprocedural Data Flow Analysis

  • 1. Demand-Driven Computation of Inter-procedural Data Flow Evelyn Duesterwald et al. POPL 1995 Presenter: Min-Yih Hsu
  • 2. Outline • Overview • Illustrating Exhaustive Data-Flow Analysis with Copy Constant Propagation (CCP) • Demand-Driven Data-Flow Analysis • Related Works • Comments
  • 5. The over-analysis problem • Users of a data-flow analysis might only need part of the results. • Generating superfluous analysis results are called over-analysis.
  • 6. The over-analysis problem • Users of a data-flow analysis might only need part of the results. • Generating superfluous analysis results are called over-analysis. • Example: In constant propagation, user only asked the constant value (or non-constant) of variable x at line n.
  • 7. The over-analysis problem • Users of a data-flow analysis might only need part of the results. • Generating superfluous analysis results are called over-analysis. • Example: In constant propagation, user only asked the constant value (or non-constant) of variable x at line n. • Traditional data-flow analysis will give you results of every variables in each line.
  • 8. The over-analysis problem • Users of a data-flow analysis might only need part of the results. • Generating superfluous analysis results are called over-analysis. • Example: In constant propagation, user only asked the constant value (or non-constant) of variable x at line n. • Traditional data-flow analysis will give you results of every variables in each line. • A real-world application: Interactive code editor
  • 12. CFG Variable Constant X C1 Y C2 Z C3 At Line n: Untouched Analyzed Traditional Approach
  • 13. CFG Variable Constant X C1 Y C2 Z C3 At Line n: Untouched Analyzed Traditional Approach a.k.a Exhaustive Approach
  • 17. CFG Variable Constant X - Y C2 Z - At Line n: Untouched Analyzed Demand-Driven Approach
  • 18. CFG Variable Constant X - Y C2 Z - At Line n: Untouched Analyzed Demand-Driven Approach Query: q=<Fy, n>
  • 19. CFG Variable Constant X - Y C2 Z - At Line n: Untouched Analyzed Demand-Driven Approach Query: q=<Fy, n>
  • 20. CFG Variable Constant X - Y C2 Z - At Line n: Untouched Analyzed Demand-Driven Approach Query: q=<Fy, n>
  • 21. Illustrating Exhaustive Data-Flow Analysis w/ Copy Constant Propagation (CCP)
  • 22. Copy Constant Propagation (CCP) A lattice L
  • 23. Copy Constant Propagation (CCP) A lattice L Data flow facts at a given program point x is a k-tuple of type L. (denoted Lk) (x)v means data flow fact for variable v
  • 24. Copy Constant Propagation (CCP) A lattice L Data flow facts at a given program point x is a k-tuple of type L. (denoted Lk) (x)v means data flow fact for variable v If variable v has constant c :
  • 25. Copy Constant Propagation (CCP) The local (intra-procedural) flow function
  • 26. Copy Constant Propagation (CCP) The local (intra-procedural) flow function
  • 27. Copy Constant Propagation (CCP) The local (intra-procedural) flow function
  • 28. Copy Constant Propagation (CCP) Inter-procedural related formulas
  • 29. Copy Constant Propagation (CCP) Inter-procedural related formulas Inter-procedural data-flow functions
  • 30. Copy Constant Propagation (CCP) Inter-procedural related formulas Inter-procedural data-flow functions
  • 31. Copy Constant Propagation (CCP) Inter-procedural related formulas Inter-procedural data-flow functions
  • 32. Copy Constant Propagation (CCP) Inter-procedural related formulas Inter-procedural data-flow functions Inter-procedural data-flow results On program point n
  • 34. CFG Variable Constant X - Y C2 Z - At Line n: Untouched Analyzed Demand-Driven Approach Query: q=<Fy, n>
  • 35. CFG Variable Constant X - Y C2 Z - At Line n: Untouched Analyzed Demand-Driven Approach Query: q=<Fy, n>
  • 36. Query (i.e. the “Demand”) q := <y, n>
  • 37. Query (i.e. the “Demand”) q := <y, n> • y is a set of data flow facts
  • 38. Query (i.e. the “Demand”) q := <y, n> • y is a set of data flow facts • n is a program point
  • 39. Query (i.e. the “Demand”) q := <y, n> • y is a set of data flow facts • n is a program point • q is a boolean type result
  • 40. Query (i.e. the “Demand”) q := <y, n> • y is a set of data flow facts • n is a program point • q is a boolean type result q tells if y is a safe approximation of the exhaustive data flow facts on program point n.
  • 41. An Example Query in CCP* q := <[a=c], 10> “Tell me if variable a is equal to constant c at line 10”
  • 47. Resolving Queries CFG Untouched Analyzed q=<y, n> Key Idea: Reversed Flow Function! Find the answer along this path
  • 49. Reverse Flow Function If f is meet-distributive…
  • 50. Reverse Flow Function If f is meet-distributive… (It’s easy to show that) fr will be join-distributive!
  • 51. Reverse Flow Function If f is meet-distributive… (It’s easy to show that) fr will be join-distributive! => We can use MFP with reversed functions along the reversed path!
  • 52. Reverse Flow Function What does answers?
  • 53. Reverse Flow Function What does answers? Node n
  • 54. Reverse Flow Function What does answers? Node n What input should I feed in…
  • 55. Reverse Flow Function What does answers? Node n What input should I feed in… In order to see w=c here?
  • 56. Reverse Flow Function What does answers? Node n What input should I feed in… In order to see w=c here?
  • 57. Reverse Flow Function What does answers? Node n What input should I feed in… In order to see w=c here? Any Integer!
  • 58. Reverse Flow Function What does answers? Node n What input should I feed in… In order to see w=c here? Impossible Any Integer!
  • 59. Reverse Flow Function What does answers? Node n What input should I feed in… In order to see w=c here? Impossible Any Integer! Asking u=c instead
  • 60. Inter-procedural Reverse Flow Function Additional Function Compositions Properties
  • 61. Inter-procedural Reverse Flow Function Additional Function Compositions Properties +
  • 62. Inter-procedural Reverse Flow Function Additional Function Compositions Properties + =
  • 63. Reverse Flow Function - Combining Everything
  • 64. Reverse Flow Function - Combining Everything Inter and Intra-procedural data-flow function
  • 65. Reverse Flow Function - Combining Everything Inter and Intra-procedural data-flow function
  • 66. Generalizing the CCP Query q := <[a=c], 10> “Tell me if variable a is equal to constant c at line 10”
  • 67. Generalizing the CCP Query q := <[a=c], 10> “Tell me if variable a is equal to constant c at line 10” What c should we ask?
  • 68. Generalizing the CCP Query q := <[a=c], 10> “Tell me if variable a is equal to constant c at line 10” What c should we ask? A more useful query: “Tell me the constant value (if it is) of variable a at line 10.” q’ := <[a], 10>
  • 69. Generalized CCP Query - New Reverse Flow Function
  • 70. Generalized CCP Query - New Reverse Flow Function
  • 71. Generalized CCP Query - New Reverse Flow Function Also need to collect the constant value!
  • 72. Generalized CCP Query - A Simple Example x = 3 y = 4 a = x r = a + 1 <[a], n>
  • 73. Generalized CCP Query - A Simple Example x = 3 y = 4 a = x r = a + 1 <[a], n>
  • 74. Generalized CCP Query - A Simple Example x = 3 y = 4 a = x r = a + 1 <[a], n> Final answer for this query
  • 75. Generalized CCP Query - A Simple Example x = 3 y = 4 a = x r = a + 1 <[a], n> Final answer for this query
  • 76. Generalized CCP Query - A Simple Example x = 3 y = 4 a = x r = a + 1 <[a], n> Final answer for this query
  • 78. Takeaways • Reverse flow function is the core of this algorithm. • It’s join-distributive property allow us to use MFP with it.
  • 79. Takeaways • Reverse flow function is the core of this algorithm. • It’s join-distributive property allow us to use MFP with it. • In the generalized query (for CCP):
  • 80. Takeaways • Reverse flow function is the core of this algorithm. • It’s join-distributive property allow us to use MFP with it. • In the generalized query (for CCP): • Instead of taking its returned value from reverse functions as the query result, we used it to guide the query propagation process.
  • 81. Time and Space Complexity • The same worst-case complexities as Sharir and Pnueli’s exhaustive (iterative worklist-based) data-flow analysis*. • Running Time: O(C x height(L) x |L| x |N|) • C is the maximum number of call sites, and N is the number of nodes. • Space: O(|L| x |N|) *Sharir, Micha, and Amir Pnueli. Two approaches to interprocedural data flow analysis. New York University. Courant Institute of Mathematical Sciences. ComputerScience Department, 1978.
  • 83.
  • 84. • Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow analysis algorithms." ACM Transactions on Programming Languages and Systems (TOPLAS) 10.1 (1988): 1-50.
  • 85. • Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow analysis algorithms." ACM Transactions on Programming Languages and Systems (TOPLAS) 10.1 (1988): 1-50. • Incremental data-flow analysis need to perform full data-flow analysis on first run. Where over-analysis problem might still happen.
  • 86. • Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow analysis algorithms." ACM Transactions on Programming Languages and Systems (TOPLAS) 10.1 (1988): 1-50. • Incremental data-flow analysis need to perform full data-flow analysis on first run. Where over-analysis problem might still happen. • IFDS / IDE
  • 87. • Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow analysis algorithms." ACM Transactions on Programming Languages and Systems (TOPLAS) 10.1 (1988): 1-50. • Incremental data-flow analysis need to perform full data-flow analysis on first run. Where over-analysis problem might still happen. • IFDS / IDE • The authors of this paper argued that their work has “less restrictions on structure of lattice and flow functions”.
  • 88. • Ryder, Barbara G., and Marvin C. Paull. "Incremental data-flow analysis algorithms." ACM Transactions on Programming Languages and Systems (TOPLAS) 10.1 (1988): 1-50. • Incremental data-flow analysis need to perform full data-flow analysis on first run. Where over-analysis problem might still happen. • IFDS / IDE • The authors of this paper argued that their work has “less restrictions on structure of lattice and flow functions”. • e.g. This work can give an approximation even with non- distributive flow function.
  • 89.
  • 90. • (IFDS / IDE cont’d)
  • 91. • (IFDS / IDE cont’d) • IFDS and IDE can not (fully) avoid over-analysis problem.
  • 92. • (IFDS / IDE cont’d) • IFDS and IDE can not (fully) avoid over-analysis problem. • e.g. For CCP problem, IFDS / IDE would tell the constant value (if any) for every variables.
  • 93. • (IFDS / IDE cont’d) • IFDS and IDE can not (fully) avoid over-analysis problem. • e.g. For CCP problem, IFDS / IDE would tell the constant value (if any) for every variables. • Strom, Robert E., and Daniel M. Yellin. "Extending typestate checking using conditional liveness analysis." IEEE Transactions on Software Engineering 19.5 (1993): 478-485.
  • 94. • (IFDS / IDE cont’d) • IFDS and IDE can not (fully) avoid over-analysis problem. • e.g. For CCP problem, IFDS / IDE would tell the constant value (if any) for every variables. • Strom, Robert E., and Daniel M. Yellin. "Extending typestate checking using conditional liveness analysis." IEEE Transactions on Software Engineering 19.5 (1993): 478-485. • Also used the idea of backward and demand-driven program analysis.
  • 96. What I Think the Paper Should Organize (Larger Box == More Important) The “Normal” Data-Flow Analysis Demand-Driven Data-Flow Analysis w/ Boolean Query Result Generalize To Non-Boolean Query Result (for CCP) Supporting Global Variables / Memory Aliasing
  • 97. The Paper’s Organization (Larger Box == More Paragraphs) The “Normal” Data-Flow Analysis
  • 98. The Paper’s Organization (Larger Box == More Paragraphs) The “Normal” Data-Flow Analysis Demand-Driven Data-Flow Analysis w/ Boolean Query Result
  • 99. The Paper’s Organization (Larger Box == More Paragraphs) The “Normal” Data-Flow Analysis Supporting Global Variables / Memory Aliasing Demand-Driven Data-Flow Analysis w/ Boolean Query Result
  • 100. The Paper’s Organization (Larger Box == More Paragraphs) The “Normal” Data-Flow Analysis Generalize To Non-Boolean Query Result (for CCP) Supporting Global Variables / Memory Aliasing Demand-Driven Data-Flow Analysis w/ Boolean Query Result
  • 101. The Paper’s Organization (Larger Box == More Paragraphs) The “Normal” Data-Flow Analysis Generalize To Non-Boolean Query Result (for CCP) Supporting Global Variables / Memory Aliasing Demand-Driven Data-Flow Analysis w/ Boolean Query Result
  • 103. Other Comments • The querying mechanism fit really well in Language Server Protocol (LSP), which is getting more attention now.
  • 104. Other Comments • The querying mechanism fit really well in Language Server Protocol (LSP), which is getting more attention now. • This paper did a pretty nice survey on related works.
  • 105. Other Comments • The querying mechanism fit really well in Language Server Protocol (LSP), which is getting more attention now. • This paper did a pretty nice survey on related works. • Some notations are inconsistent across paragraphs.
  • 106. Other Comments • The querying mechanism fit really well in Language Server Protocol (LSP), which is getting more attention now. • This paper did a pretty nice survey on related works. • Some notations are inconsistent across paragraphs. • Amortized Time Complexity Analysis Please!!!
  • 108. Summary • This work used queries to drive the data-flow analysis process to avoid generating redundant results that would never be used.
  • 109. Summary • This work used queries to drive the data-flow analysis process to avoid generating redundant results that would never be used. • The algorithm performed a revered data-flow analysis from the point where users are inquiring. • The reverse data-flow function played an important role.
  • 110. Summary • This work used queries to drive the data-flow analysis process to avoid generating redundant results that would never be used. • The algorithm performed a revered data-flow analysis from the point where users are inquiring. • The reverse data-flow function played an important role. • The query algorithm was augmented to support arbitrary result types. In addition to the basic boolean type.
  • 111. Summary • This work used queries to drive the data-flow analysis process to avoid generating redundant results that would never be used. • The algorithm performed a revered data-flow analysis from the point where users are inquiring. • The reverse data-flow function played an important role. • The query algorithm was augmented to support arbitrary result types. In addition to the basic boolean type. • Regarding the time complexity, this algorithm is no worse than the exhaustive data-flow analysis. • Just as the incremental data-flow analysis, we hope to see the amortized time complexity.