Consider, for example, the following code:The results of Array Dataflow Analysis can be presented in many ways, all equivalent up to syntactical embellishments: source functions, a single assignment code, or a system of affine recurrence equations (SARE). The later presentation is the one that fits best with our aims in this paper; we will use the Alpha notation to represent SAREs [13]. The important point here is not notation, but the fact that an imperative program can be mechanically converted to a SARE provided it meets the following constraints:Its Dataflow Graph as given by our automatic analysis tool, PAF, is:DO i=1,n s(i)=a(i)*b(i) (i1) END DO s(0)=0 (i2) DO i=1,n s(i)=s(i-1)+s(i) (i3) END DONote that the source of s(i-1) in i3 is a conditional expression. Such expressions occur frequently in Dataflow Analysis and are called quasts (Quasi-Affine Selection Trees) in what follows.Source of s(i-1) in i3 ; * if [ i-2>=0 ] then (i3,i-1) * if [ i-1=0 ] then (i2) Source of s(i) in i3 ; * if [ true ] then (i1,i)
The DFG of our example program can be expressed as the following SARE:The reason for using SAREs as the basis of our work is that SAREs are referentially transparent, which means that a variable can be freely replaced by its value as given by the right hand side of the equation that defines it. This is the main tool in our reduction detection method.In this notation, conditions such as { 1<=i<=n } define iterations domains, while the subscripts expressions like i-1 are shorthand notations for dependence functions, in this case l i. (i-1).i1[i] = 1<=i<=n : a[i] * b[i] ; i3[i] = case i=0 : 0 ; 1<=i<=n : i3[i-1] + i1[i] ; esac