Pointer Analysis for CASH Compiler Framework Deepak Garg Himanshu Jain Spring 2005
Project Goals Andersen’s Pointer Analysis for CASH –Flow sensitive formulation on Pegasus circuits –Context insensitive –Intra-procedural Constraint based formulation –Solve using Banshee Use points-to sets to remove token edges between loads and stores
Andersen’s Analysis (without SSA) a = &b b = &c a = &d d = &e a bd ce Points-to relationships Flow Insensitive
Andersen’s Analysis (with SSA) a = &b b = &c a’ = &d d = &e a bd ce Points-to relationships Flow Sensitive a’
Implementing Andersen’s for PEGASUS circuit Assign a type x to each wire x x has the form ref (l x, P x ) l x is the name of a location (register/memory) P x is a set of types that x can point to Types are sets
Assignment constraint copy x = y ref (l x, P x ) ref (l y, P y ) Constraint: P y µ P x copy = hold/nop/reg/cast/eta
Join nodes Constraints: P y µ P x P z µ P x join = mu/mux/switch ref (l x, P x ) ref (l y, P y ) x = (y, z) ref (l z, P z )
Call nodes ref (l w, ref (“malloc”, Y)) op_cal ref (l v, ref (l x, P x )) l x, P x and X are new ref (l w, _) op_cal ref (l v, U) Any function name U is the universal set
Store and load Constraint: P y µ P x ref (l y, P y ) *w = y y ref (l w, ref(l x, P x )) w z = *w ref (l w, ref(l x, P x )) w z ref (l z, P z ) Constraint: P x µ P z
Token Dependencies Token dependencies depict temporal dependence between operations Unnecessary token edges reduce parallelization Token dependencies between load and store operations can be removed using points-to sets
Identifying Token Dependencies Just looking at token edges is not enough load tkand store Indirect dependence Take the transitive closure of token edges
Removing Token Dependencies Identify read and write sets for each load and store node load x = *y store *u = v Read1 = {y, pts_to(y)} Write1 = {x} Read2 = {v, u} Write2 = {pts_to(u)} Dependence is false when Read1 Å Write2 = Read2 Å Write1 = Write1 Å Write2 =
Implementation Constraints are solved using Banshee framework Implementation reports false dependencies between nodes Very useful in detecting false dependencies with malloc() calls Tested on small examples, plan to run on real benchmarks