Changes between Version 3 and Version 4 of AliasAnalysis


Ignore:
Timestamp:
04/22/16 13:29:43 (10 years ago)
Author:
zmanchun
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AliasAnalysis

    v3 v4  
    22
    33Goal: help POR to be more precise
     4
     5Concepts:
     6
     7Assume that all statements are "atomic" actions, for simplicity.
     8
     9dyscope: a dynamic instance of a lexical scope, with values assigned to each variable declared in the lexical scope
     10
     11call frame: a call frame contains a function and a location of the function (and the corresponding dyscope of the location can be obtained)
     12
     13call stack: a stack of call frames
     14
     15process: the state of a process includes its call stacks and its current program location (and thus the current dyscope)
     16
     17state: a state contains a dyscope tree and a number of processes
     18
     19independent statements: two statements `s1` and `s2` are said to be independent if for any state `S` where `s1` and `s2` are enabled,
     201. `s2` is still enabled in `exec(S, s1)` and vice versa; and
     212. `exec(exec(S, s1), s2) = exec(exec(S, s2), s1) `
     22where `exec(S, s)` denotes the state resulted by executing statement `s` at state `S`.
     23Two independent statements commute.
     24
     25ample set: a set of processes at a certain state such that for all processes not in the ample set, all their reachable statements commute with any enabled statement of any process in the ample set
     26
     27The key of the POR is to find out the minimal ample set for a state. Usually, the dependency of statements
    428
    529== Examples ==
     
    1842
    1943int main() {
    20   int *p = &x;
     44  int *p = &x;//s0'
    2145
    2246  $proc p1 = $spawn f(&y);
     
    3660
    3761In fact, the ample set of any reachable state of this program is always `{p0}` and `{p1}`.
    38 
     62For example, if the current state is `S=(p0: s0', p1: s1)`, the POR algorithm looks at all reachable statements of `p0` and finds that `OR(p0, s0')` is `{x}` and similarly `OR(p1, s1)` is `{y}`, thus the `{p0}` or `{p1}` is an ample set.
    3963
    4064=== Example 2 ===
     
    4468
    4569
    46