May-Alias Analysis for L3 - PowerPoint PPT Presentation

About This Presentation
Title:

May-Alias Analysis for L3

Description:

... performance payoffs may not be worthwhile in a JIT compiler Bibliography Modern Compiler Implementation in ML, ... Goyal Advanced Compiler Design and ... – PowerPoint PPT presentation

Number of Views:117
Avg rating:3.0/5.0
Slides: 13
Provided by: cmu130
Learn more at: http://www.cs.cmu.edu
Category:

less

Transcript and Presenter's Notes

Title: May-Alias Analysis for L3


1
May-Alias Analysis for L3
  • David Abraham, Elisabeth Crawford, Sue Ann Hong,
    and
  • Virginia Vassilevska

2
Introduction
  • What does alias mean?
  • Two pointers alias each other if both point to
    the same memory location
  • What is alias analysis?
  • Determining what each pointer references, so we
    can tell if two pointers alias each other
  • Why is alias analysis useful?
  • Many code optimizations are overly conservative
    without alias information

memory
p
q
3
Use of Alias-Analysis
  • BEFORE
  • a mem(p)
  • mem(q) b
  • c mem(p)
  • d a c
  • Is q an alias of p?
  • Yes or Dont Know
  • mem(q) store kills availability of mem(p)
  • No
  • apply common sub-expression elimination,
  • and then copy propagation
  • AFTER
  • a mem(p)
  • mem(q) b
  • d a a

4
May-Alias Analysis
  • Cant statically track what each pointer refers
    to exactly
  • So be conservative - track what each pointer may
    refer to
  • p, q may alias each other if they may refer to
    same memory location

5
Some May-Alias Rules
  • Let alias(q) set of memory locations that q may
    alias

statement alias(p)
p q alias(q)
p q c, where c is a const loc c loc in alias(q)
p function() all memory locations
s p alloc(), where s is an internal label of this statement alias(p) s
6
May-Alias Dataflow Analysis
  • For each statement s
  • IN(s) alias information for each pointer on
    entry to s
  • OUT(s) alias information for each pointer on
    exit from s
  • IN(s)unionpOUT(p), where p is predecessor of s
  • OUT IN with statement rule applied

7
Experimental Setup
  • L3 Test Suite
  • Correctness tests (not reported here)
  • Big directory performance tests
  • Tested combinations of optimizations to identify
    performance gains and hits

Key Translation
REF Reference
3ADR Three-Address Code
CF Constant Folding
CTP Const Propagation
CSE Common Subexpression Elimination
CPP Copy Propagation
8
Runtime Results
9
More Runtime Results
10
Code Transformation Results
11
Conclusions
  • Alias analysis can greatly increase the
    effectiveness of optimizations, in terms of
  • Runtime performance
  • Temp usage
  • Alias analysis works best in tandem with copy
    propagation
  • Alias analysis is expensive performance payoffs
    may not be worthwhile in a JIT compiler

12
Bibliography
  1. Modern Compiler Implementation in ML, Appel
  2. On the importance of points-to-analysis and other
    memory disambiguation methods for C programs,
    Ghiya, Lavery, and Sehr
  3. An improved intra-procedural may-alias analysis
    algorithm, Goyal
  4. Advanced Compiler Design and Implementation,
    Muchnick
  5. Survey of Alias Analysis, Wu
Write a Comment
User Comments (0)
About PowerShow.com