Points-to and Side-effect Analyses for Programs Built with Precompiled Libraries PowerPoint PPT Presentation

presentation player overlay
1 / 26
About This Presentation
Transcript and Presenter's Notes

Title: Points-to and Side-effect Analyses for Programs Built with Precompiled Libraries


1
Points-to and Side-effect Analyses for Programs
Built with Precompiled Libraries
  • Atanas (Nasko) Rountev
  • Barbara G. Ryder
  • Rutgers University

2
Whole-program Analysis
  • Static analysis
  • Optimizing compilers and SE tools
  • Whole-program analysis
  • Complex global properties
  • Aggressive optimizations
  • Helps humans
  • Large body of work

3
Weaknesses
  • Need the whole program
  • Incomplete programs
  • Parts not implemented yet
  • Separate compilation
  • Precompiled components, no source
  • Limited applicability

4
Our Target Problem
  • Goal handle incompleteness and separation
  • Specific instance
  • C programs with precompiled libraries
  • Points-to analysis and side-effect analysis
  • Importance
  • Points-to and side-effect info is necessary
  • Techniques useful for similar problems

5
Overview
  • Introduction
  • Analysis for Programs with Libraries
  • Analysis of Libraries
  • Library Summary Information
  • Analysis of Library Clients
  • Empirical Results
  • Summary

6
Programs Built with Libraries
  • Library module
  • Write the library
  • Create library binary
  • Client module
  • Write the client
  • Compile and link with library binary
  • No library source
  • Need separate analyses

7
Separate Analysis of a Library Module
  • Unknown client modules
  • Simulated by an abstract client

Abstract Client
Whole-program Analyzer
Library Solution
Library Module
8
Separate Analysis of a Client Module
  • Use precomputed summary information
  • Enables precise analysis

Client Module
Whole-program Analyzer
Client Solution
Library Summary
9
Library Summary Information
  • Used later to analyze client modules
  • Enclosed with library binary, reusable

10
Points-to and Side-effect Analyses
  • What variables may p refer to?
  • Andersens analysis
  • What variables may be modified?
  • MOD set for each statement
  • Pointer resolution p0
  • Procedure calls backward propagation
  • Wide range of applications

11
Overview
  • Introduction
  • Analysis for Programs with Libraries
  • Analysis of Libraries
  • Library Summary Information
  • Analysis of Library Clients
  • Empirical Results
  • Summary

12
Separate Analysis of Libraries
  • Unknown clients
  • Access through library interface
  • Abstract client
  • Placeholder variable v0
  • Placeholder procedure p0
  • Apply whole-program analyses
  • Reuse of implementation

13
Abstract Client

proc p0(v1,...,vn) returns ret0 v0 vi
v0 v (v ? interface) v0 v0
v0 p0 v0 v0 v0 v0 v0
(v0)(v0,...,v0) ret0 v0

14
Library Example

global g proc p1(p,fp) proc p2(r)
local s, t, q r -(r) t
p q s p2(q) t s
(fp)(t,g)
s1
MOD(s1) v0,g
15
Overview
  • Introduction
  • Analysis for Programs with Libraries
  • Analysis of Libraries
  • Library Summary Information
  • Analysis of Library Clients
  • Empirical Results
  • Summary

16
Library Summary Information
  • Used for separate analysis of clients
  • Enclosed with library binary, reusable
  • Input to whole-program analyzers
  • Best possible precision
  • Basic summary
  • Precision-preserving optimizations
  • Reduce summary size
  • Reduce cost of separate analysis of clients

17
Basic Summary

global g proc p1(p,fp) local s1, t, q
t p q s p2(q) t s
(fp)(t,g) proc p2(r) r -(r)
18
Summary Optimizations
  • Replace sets of equivalent variables
  • Have the same points-to sets
  • Replace with a set representative
  • Remove irrelevant summary elements
  • Smaller points-to and MOD sets in clients
  • Inactive variables
  • Inaccessible variables
  • Use solution from separate library analysis

19
Optimized Summary

proc p1(p,fp) ts tp (fp)(t,g) qs
proc p2(r) p2(q)
proc p1(rep1,fp) (fp)(rep1,g)
Mod(p1) (t,I) Call(p1) (p2,D) (fp,I)
Mod(p2) (r,I)
Mod(p1) (rep1,I) Call(p1) (fp,I)
20
Overview
  • Introduction
  • Analysis for Programs with Libraries
  • Analysis of Libraries
  • Library Summary Information
  • Analysis of Library Clients
  • Empirical Results
  • Summary

21
Experiments
  • Library and client points-to analyses
  • BANE toolkit (UC Berkeley)
  • Summary generation and optimization
  • Publicly available C programs
  • Include general-purpose libraries
  • Sun Ultra-60, 360MHz, 512K memory

22
Data Programs

23
Cost of Library Analysis

24
Cost of Client Analysis

25
Cost Reduction for Client Analysis

26
Summary
  • Challenges for whole-program analysis
  • Programs with precompiled libraries
  • Points-to and side-effect analyses
  • Separate analysis of libraries and clients
  • Summary construction
  • Future work
  • Other points-to analyses
  • Client analyses
Write a Comment
User Comments (0)
About PowerShow.com