Changes between Version 4 and Version 5 of AliasAnalysis


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

--

Legend:

Unmodified
Added
Removed
Modified
  • AliasAnalysis

    v4 v5  
    2929== Examples ==
    3030
    31 Let `s` be a statement, and `p` be a pointer, let `O(p, s)` be the set of objects that `p` may alias to at the location where `s` may be enabled. Note that each statement has a unique source location.
    32 Let a state `S` be a tuple `(p0: s0, p1: s1, ...)`, which contains the statement that maybe enabled for each process. For simplicity, we ignore the value of variables here and assume that the execution of each process is always deterministic.
     31Let `s` be a statement, and `p` be a pointer, let `L(s)` be the source location of `s`, let `O(p, s)` be the set of objects that `p` may alias to at `L(s)`.\\
     32Let `LR(s)` be the set of locations reachable from `s`, let `OR(p, s)` be the set of objects that `p` may alias to at any location of `LR(s)`. \\
     33Note that each statement has a unique source location.\\
     34Let a state `S` be a tuple `(p0: s0, p1: s1, ...)`, which contains the statement that maybe enabled for each process. \\
     35For simplicity, the dyscope tree and the call stacks are omitted and we assume that the execution of each process is always deterministic.
    3336
    3437=== Example 1 ===
     
    5760`O(q, s1)={y}`
    5861
     62and
     63`OR(p, s0)={x}`
     64`OR(1, s1)={y}`
     65
    5966Suppose the current state is `S=(p0: s0, p1:s1)`, i.e., the enable statement of `p0` and `p1` is `s0` and `s1`, respectively. Since we know **statically** that `O(p, s0)` never intersect with `O(q, s1)`, then we know that `s0` and `s1` commute. So the ample set at `S` is either `{p0}` or `{p1}`.
    6067
     
    6572Now let's look at a more complicated example which is obtained by modifying **Example 1**.
    6673
     74{{{
     75int x=0, y=0;
     76
     77void f(int *q) {
     78  *q = 1; //s1: would like to know p!=q here
     79  q = &x; //s2
     80  *q = 1; //s3
     81}
     82
     83int main() {
     84  int *p = &x;//s0'
     85
     86  $proc p1 = $spawn f(&y);
     87  *p = 99; //s0: would like to know p!=q here
     88  $wait(p1);
     89}
     90}}}
     91
     92case 1: current state `S=(p0:s0', p1:s1)`
    6793
    6894
    6995
     96