Improving Dataflow Analysis with Path Profiles - PowerPoint PPT Presentation

About This Presentation
Title:

Improving Dataflow Analysis with Path Profiles

Description:

Identify 'hot paths,' frequently run paths in a CFG by doing a training ... Haven't lost any information from orginal CFG. New Knowledge with HPG. At H14, a b=6 ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 16
Provided by: csewe4
Learn more at: https://cseweb.ucsd.edu
Category:

less

Transcript and Presenter's Notes

Title: Improving Dataflow Analysis with Path Profiles


1
Improving Data-flow Analysis with Path Profiles
  • Glenn Ammons James R. Larus
  • University of Wisconsin-Madison
  • 1998
  • Presented by Jessica Friis

2
Problem and Approach
  • Some paths in a CFG are not run
  • A small number of paths often make up a large
    portion of the runtime
  • By duplicating some frequently used paths, we can
    improve analysis on them

3
Outline
  • Identify hot paths, frequently run paths in a
    CFG by doing a training run on the program
  • Duplicate hot paths to form a new CFG, the Hot
    Paths Graph, or HPG
  • The extra paths allow more precise analysis.
    Constant propagation is looked at here
  • Reduce the graph to preserve only the valuable
    solutions for the rest of compilation.
  • Implementation and Results

4
Example CFG
  • Hot paths taken during sample executions
  • A, B, C, E, F, H, I, X
  • A, B, D, E, F, H
  • B, D, E, G, H
  • B, D, E, F, H, I, X
  • Use Ball-Larus path profiles
  • Chose paths so that they cover 97 of execution
    time

5
Finite Automaton for the path profile
  • The retrieval tree is used as a simple
    representation of the automaton.
  • CFG edges label the transitions
  • At 13, 15, or 16, a B takes you back to 0
  • Anything else not labeled goes to an error state
  • These extra states/edges are left out for
    readability

6
Trace CFG and FA to get HPG
  • Uses Holley and Rosen's data flow tracing
    algorithm
  • The HPG will have nodes made up of a tuple v,q
    where v is a vertex from the original CFG and q
    is a state in the automaton
  • A worklist algorithm starts with r,q? where r
    is the starting node in the CFG and q? is the
    starting node in the automaton. It follows the
    edges in the CFG and automaton to create a new HPG

7
New HPG
  • The diagonally striped nodes (A0 and B0)
    represent the beginnings of the forward paths
  • The shaded nodes represent the error states in
    the automaton (paths that are not 'hot.')
  • Haven't lost any information from orginal CFG

8
New Knowledge with HPG
  • At H14, ab6
  • At H12, H15, ab5
  • At H13, ab4
  • At H14H15, i 1
  • At I17, n is 1
  • These are new constant results

9
Eliminate unneeded vertices
  • Heuristic algorithm for identifying the most
    valuable duplicated vertices.
  • Others can be reduced/combined to form rHPG for
    further compilation.

10
Implementation
  • Implemented as two new paths in SUIF compiler, PP
    and PW
  • Compile into intermediate form
  • PP pass instrumented intermediate form for path
    profiling
  • Running the result gives us our path profile
  • Next the intermediate code and the path profile
    is run through PW
  • PW generates the HPG, discovers new constants,
    and generates the rHPG
  • The output is compiled into an executable

11
Speedup of SPEC95 benchmarks
  • The benchmarks with the most new constants found
    sped up, the other slowed
  • The increase in program size causes the slowdown

12
Program Costs
  • Cost of duplication in size of CFG ? HPG
  • Go increased 184
  • All others increasaed an average of 32
  • Cost of duplication in size of CFG ? rHPG
  • Go increased 77
  • All others increased less than 10
  • Analysis time
  • Go took 6 times longer
  • All others took an average of 61 longer

13
Contributions
  • Shows improvements in the precision of data flow
    analysis through guided duplication
  • Describes how to reduce hot path graphs
  • Preserves path profiling information through
    transformation from CFG to HPG to rHPG
  • Applies to constant propagation to show
    performance increase

14
Issues
  • The cost of analysis is significant
  • Only should be used just before release
  • The increased graph size slows down the running
    time
  • Specific reasons are not known, but larger
    program size is a possibility
  • They only tested with a single optimization
  • Adding in other optimizations may give more
    speedup gains

15
Questions?
Write a Comment
User Comments (0)
About PowerShow.com