SlideShare a Scribd company logo
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
Paper Study - Demand-Driven Computation of Interprocedural Data Flow
• 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.
Paper Study - Demand-Driven Computation of Interprocedural Data Flow
• (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.
Ad

More Related Content

Similar to Paper Study - Demand-Driven Computation of Interprocedural Data Flow (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
István Dávid
 
TINET_FRnOG_2008_public
TINET_FRnOG_2008_publicTINET_FRnOG_2008_public
TINET_FRnOG_2008_public
Davide Cherubini
 
9.2. SE5072_Multi-fidelity for data s.pdf
9.2. SE5072_Multi-fidelity for data s.pdf9.2. SE5072_Multi-fidelity for data s.pdf
9.2. SE5072_Multi-fidelity for data s.pdf
AmirhosseinShokrani
 
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
Eelco Visser
 
Crv
CrvCrv
Crv
Ashar78
 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone Frameworks
Eelco 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 LSH
Maruf Aytekin
 
HOP-Rec_RecSys18
HOP-Rec_RecSys18HOP-Rec_RecSys18
HOP-Rec_RecSys18
Matt 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 Requirements
Lionel 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 View
Waqas 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-study
Ayush Bhardwaj
 
PS
PSPS
PS
NRSHEKAR
 
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
herbps10
 
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
Sabesan 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 iswc
SydGillani
 
clique-summary
clique-summaryclique-summary
clique-summary
Jia Wang
 
CS-323 DAA.pdf
CS-323 DAA.pdfCS-323 DAA.pdf
CS-323 DAA.pdf
priyadharshinic22
 
3-Recursion.ppt
3-Recursion.ppt3-Recursion.ppt
3-Recursion.ppt
TrnHuy921814
 
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
István Dávid
 
9.2. SE5072_Multi-fidelity for data s.pdf
9.2. SE5072_Multi-fidelity for data s.pdf9.2. SE5072_Multi-fidelity for data s.pdf
9.2. SE5072_Multi-fidelity for data s.pdf
AmirhosseinShokrani
 
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
Eelco Visser
 
Compiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone FrameworksCompiler Construction | Lecture 11 | Monotone Frameworks
Compiler Construction | Lecture 11 | Monotone Frameworks
Eelco 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 LSH
Maruf Aytekin
 
HOP-Rec_RecSys18
HOP-Rec_RecSys18HOP-Rec_RecSys18
HOP-Rec_RecSys18
Matt 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 Requirements
Lionel 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 View
Waqas 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-study
Ayush 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 R
herbps10
 
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
Sabesan 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 iswc
SydGillani
 
clique-summary
clique-summaryclique-summary
clique-summary
Jia Wang
 

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
Min-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 Blocks
Min-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 LLVM
Min-Yih Hsu
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
Min-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 Ugly
Min-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 al
Min-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 Info
Min-Yih Hsu
 
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern Compilers
Min-Yih Hsu
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCL
Min-Yih Hsu
 
Trace Scheduling
Trace SchedulingTrace Scheduling
Trace Scheduling
Min-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 AOSP
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 From
Min-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 Blocks
Min-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 LLVM
Min-Yih Hsu
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
Min-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 Ugly
Min-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 al
Min-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 Info
Min-Yih Hsu
 
From V8 to Modern Compilers
From V8 to Modern CompilersFrom V8 to Modern Compilers
From V8 to Modern Compilers
Min-Yih Hsu
 
Introduction to Khronos SYCL
Introduction to Khronos SYCLIntroduction to Khronos SYCL
Introduction to Khronos SYCL
Min-Yih Hsu
 
Trace Scheduling
Trace SchedulingTrace Scheduling
Trace Scheduling
Min-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 AOSP
Min-Yih Hsu
 
Ad

Recently uploaded (20)

Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation  A Smarter Way to ScaleMaximizing ROI with Odoo Staff Augmentation  A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
SatishKumar2651
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdfHow to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
victordsane
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Gojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service BusinessGojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service Business
XongoLab Technologies LLP
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
AEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural MeetingAEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural Meeting
jennaf3
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
The Elixir Developer - All Things Open
The Elixir Developer - All Things OpenThe Elixir Developer - All Things Open
The Elixir Developer - All Things Open
Carlo Gilmar Padilla Santana
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation  A Smarter Way to ScaleMaximizing ROI with Odoo Staff Augmentation  A Smarter Way to Scale
Maximizing ROI with Odoo Staff Augmentation A Smarter Way to Scale
SatishKumar2651
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdfHow to avoid IT Asset Management mistakes during implementation_PDF.pdf
How to avoid IT Asset Management mistakes during implementation_PDF.pdf
victordsane
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
AEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural MeetingAEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural Meeting
jennaf3
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Ad

Paper Study - Demand-Driven Computation of Interprocedural Data Flow

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