Download presentation
Presentation is loading. Please wait.
Published byShayna Dike Modified over 9 years ago
1
1 May-Alias Analysis for L3 David Abraham, Elisabeth Crawford, Sue Ann Hong, and Virginia Vassilevska
2
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 pq memory
3
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 Don’t Know: mem(q) store kills availability of mem(p) No: apply common sub-expression elimination, and then copy propagation AFTER 1. a = mem(p) 2. mem(q) = b 3. d = a + a
4
4 May-Alias Analysis Can’t 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
5 Some May-Alias Rules Let alias(q) = set of memory locations that q may alias statementalias(p) = p = qalias(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
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)=union p OUT(p), where p is predecessor of s OUT = IN with statement rule applied
7
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 KeyTranslation REFReference 3ADRThree-Address Code CFConstant Folding CTPConst Propagation CSECommon Subexpression Elimination CPPCopy Propagation
8
8 Runtime Results
9
9 More Runtime Results
10
10 Code Transformation Results
11
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
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.