on demand parametric array dataflow analysis · 6 experimental results 7 conclusion. motivation...

86
January 21, 2013 1 / 43 On Demand Parametric Array Dataflow Analysis Sven Verdoolaege Hristo Nikolov Todor Stefanov Leiden Institute for Advanced Computer Science ´ Ecole Normale Sup ´ erieure and INRIA January 21, 2013

Upload: others

Post on 08-Nov-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

January 21, 2013 1 / 43

On Demand Parametric Array Dataflow Analysis

Sven Verdoolaege Hristo Nikolov Todor Stefanov

Leiden Institute for Advanced Computer ScienceEcole Normale Superieure and INRIA

January 21, 2013

Page 2: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

January 21, 2013 2 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 3: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation January 21, 2013 3 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 4: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation General Motivation January 21, 2013 4 / 43

Motivation

Dataflow analysis determines for read access in a statementinstance, the statement instance that wrote the value being readMany uses in polyhedral analysis/compilation

I array expansionI schedulingI equivalence checkingI optimizing computation/communication overlap in MPI programsI derivation of process networksI . . .

Standard dataflow analysis (Feautrier) requires static affine inputprograms

Extensions are needed for programs with dynamic/non-affineconstructs

Page 5: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation General Motivation January 21, 2013 4 / 43

Motivation

Dataflow analysis determines for read access in a statementinstance, the statement instance that wrote the value being readMany uses in polyhedral analysis/compilation

I array expansionI schedulingI equivalence checkingI optimizing computation/communication overlap in MPI programsI derivation of process networksI . . .

Standard dataflow analysis (Feautrier) requires static affine inputprograms

Extensions are needed for programs with dynamic/non-affineconstructs

Page 6: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation Our Motivation January 21, 2013 5 / 43

Our Motivation: Derivation of Process Networks

Main purpose: extract task level parallelism from dataflow graph

statement → processflow dependence → communication channel

⇒ requires dataflow analysis

Processes are mapped to parallel hardware (e.g., FPGA)

Example:

for (i = 0; i < n; ++i) {a = f();

g(a);

}

f

g

Page 7: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation Our Motivation January 21, 2013 5 / 43

Our Motivation: Derivation of Process Networks

Main purpose: extract task level parallelism from dataflow graph

statement → processflow dependence → communication channel

⇒ requires dataflow analysis

Processes are mapped to parallel hardware (e.g., FPGA)

Example:

for (i = 0; i < n; ++i) {a = f();

g(a);

}

f

g

Page 8: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation Our Motivation January 21, 2013 6 / 43

Dynamic Process Networks

int state = 0;for (i = 0; i <= 10; i++) {sample = radioFrontend();

if (state == 0) {state = detect(sample);

} else {state = decode(sample, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

P_1state=0

P_3if()

state

P_2radioFrontEnd()

P_4detect()

sample

P_5decode()

sampleenableenable

P_6processSample0

enable

P_7processSample1)

enable

iteration stateiterationstate

sample

sample

additional control channelsdetermine operation of data channelsdataflow analysis needs to remain exact,but may depend on run-time information

Page 9: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation Our Motivation January 21, 2013 6 / 43

Dynamic Process Networks

int state = 0;for (i = 0; i <= 10; i++) {sample = radioFrontend();

if (state == 0) {state = detect(sample);

} else {state = decode(sample, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

P_1state=0

P_3if()

state

P_2radioFrontEnd()

P_4detect()

sample

P_5decode()

sampleenableenable

P_6processSample0

enable

P_7processSample1)

enable

iteration stateiterationstate

sample

sample

additional control channelsdetermine operation of data channelsdataflow analysis needs to remain exact,but may depend on run-time information

Page 10: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Motivation Our Motivation January 21, 2013 6 / 43

Dynamic Process Networks

int state = 0;for (i = 0; i <= 10; i++) {sample = radioFrontend();

if (state == 0) {state = detect(sample);

} else {state = decode(sample, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

P_1state=0

P_3if()

state

P_2radioFrontEnd()

P_4detect()

sample

P_5decode()

sampleenableenable

P_6processSample0

enable

P_7processSample1)

enable

iteration stateiterationstate

sample

sample

additional control channelsdetermine operation of data channelsdataflow analysis needs to remain exact,but may depend on run-time information

Page 11: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis January 21, 2013 7 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 12: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 8 / 43

Standard Array Dataflow AnalysisGiven a read from an array element, what was the last write tothe same array element before the read?

Simple case: array written through a single reference

for (i = 0; i < N; ++i)

for (j = 0; j < N - i; ++j)

F: a[i+j] = f(a[i+j]);

for (i = 0; i < N; ++i)

W: Write(a[i]);

F

W

a

A1

A2

Access relations:A1:=[N]->{F[i,j]->a[i+j]:0<=i<N and 0<=j<N-i};

A2:=[N]->{W[i] -> a[i] : 0 <= i < N };

Map to all writes: R := A2 . (A1ˆ-1);[N] -> { W[i] -> F[i’,i-i’] : 0 <= i,i’< N and i’<= i }

Last write: lexmax R; # [N] -> { W[i] -> F[i,0] : 0 <= i < N }

In general: impose lexicographical order on shared iterators

Page 13: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 8 / 43

Standard Array Dataflow AnalysisGiven a read from an array element, what was the last write tothe same array element before the read?

Simple case: array written through a single reference

for (i = 0; i < N; ++i)

for (j = 0; j < N - i; ++j)

F: a[i+j] = f(a[i+j]);

for (i = 0; i < N; ++i)

W: Write(a[i]);

F

W

a

A1

A2

Access relations:A1:=[N]->{F[i,j]->a[i+j]:0<=i<N and 0<=j<N-i};

A2:=[N]->{W[i] -> a[i] : 0 <= i < N };

Map to all writes: R := A2 . (A1ˆ-1);[N] -> { W[i] -> F[i’,i-i’] : 0 <= i,i’< N and i’<= i }

Last write: lexmax R; # [N] -> { W[i] -> F[i,0] : 0 <= i < N }

In general: impose lexicographical order on shared iterators

Page 14: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 8 / 43

Standard Array Dataflow AnalysisGiven a read from an array element, what was the last write tothe same array element before the read?

Simple case: array written through a single reference

for (i = 0; i < N; ++i)

for (j = 0; j < N - i; ++j)

F: a[i+j] = f(a[i+j]);

for (i = 0; i < N; ++i)

W: Write(a[i]);

F

W

a

A1

A2

Access relations:A1:=[N]->{F[i,j]->a[i+j]:0<=i<N and 0<=j<N-i};

A2:=[N]->{W[i] -> a[i] : 0 <= i < N };

Map to all writes: R := A2 . (A1ˆ-1);[N] -> { W[i] -> F[i’,i-i’] : 0 <= i,i’< N and i’<= i }

Last write: lexmax R; # [N] -> { W[i] -> F[i,0] : 0 <= i < N }

In general: impose lexicographical order on shared iterators

Page 15: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 8 / 43

Standard Array Dataflow AnalysisGiven a read from an array element, what was the last write tothe same array element before the read?

Simple case: array written through a single reference

for (i = 0; i < N; ++i)

for (j = 0; j < N - i; ++j)

F: a[i+j] = f(a[i+j]);

for (i = 0; i < N; ++i)

W: Write(a[i]);

F

W

a

A1

A2

Access relations:A1:=[N]->{F[i,j]->a[i+j]:0<=i<N and 0<=j<N-i};

A2:=[N]->{W[i] -> a[i] : 0 <= i < N };

Map to all writes: R := A2 . (A1ˆ-1);[N] -> { W[i] -> F[i’,i-i’] : 0 <= i,i’< N and i’<= i }

Last write: lexmax R; # [N] -> { W[i] -> F[i,0] : 0 <= i < N }

In general: impose lexicographical order on shared iterators

Page 16: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 8 / 43

Standard Array Dataflow AnalysisGiven a read from an array element, what was the last write tothe same array element before the read?

Simple case: array written through a single reference

for (i = 0; i < N; ++i)

for (j = 0; j < N - i; ++j)

F: a[i+j] = f(a[i+j]);

for (i = 0; i < N; ++i)

W: Write(a[i]);

F

W

a

A1

A2

Access relations:A1:=[N]->{F[i,j]->a[i+j]:0<=i<N and 0<=j<N-i};

A2:=[N]->{W[i] -> a[i] : 0 <= i < N };

Map to all writes: R := A2 . (A1ˆ-1);[N] -> { W[i] -> F[i’,i-i’] : 0 <= i,i’< N and i’<= i }

Last write: lexmax R; # [N] -> { W[i] -> F[i,0] : 0 <= i < N }

In general: impose lexicographical order on shared iterators

Page 17: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 8 / 43

Standard Array Dataflow AnalysisGiven a read from an array element, what was the last write tothe same array element before the read?

Simple case: array written through a single reference

for (i = 0; i < N; ++i)

for (j = 0; j < N - i; ++j)

F: a[i+j] = f(a[i+j]);

for (i = 0; i < N; ++i)

W: Write(a[i]);

F

W

a

A1

A2

Access relations:A1:=[N]->{F[i,j]->a[i+j]:0<=i<N and 0<=j<N-i};

A2:=[N]->{W[i] -> a[i] : 0 <= i < N };

Map to all writes: R := A2 . (A1ˆ-1);[N] -> { W[i] -> F[i’,i-i’] : 0 <= i,i’< N and i’<= i }

Last write: lexmax R; # [N] -> { W[i] -> F[i,0] : 0 <= i < N }

In general: impose lexicographical order on shared iterators

Page 18: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Standard January 21, 2013 9 / 43

Standard Array Dataflow AnalysisMultiple Potential Sources

Dataflow is typically performed per read access (“sink”) C

Corresponding writes (“potential sources”) P are considered in turn

Map to all potential source iterations: DmemC ,P = (A−1

P ◦ AC) ∩ BPC

(“memory based dependences”; BPC : P executed before C)

Source may already be known for some sink iterations⇒ compute partial lexicographical maximum

(U′,D) = lexmaxU

M

U: sink iterations for which no source has been foundM: part of memory based dependences for particular potential sourceU′ = U \ dom MM′ = lexmax(M ∩ (U → ran M))

Note: here, dependence relations map sink iterations to source iterations

Page 19: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Fuzzy January 21, 2013 10 / 43

Fuzzy Array Dataflow Analysis

Introduces parameters for each lexmax involving dynamic behavior

Parameters represent dynamic solution of lexmax operation

Derives properties on parameters after dataflow analysis(using resolution)

Parametric result is exact

Parameters can be projected out to obtain approximate but staticdataflow

Main problem for deriving process networks:Introduces too many parameters⇒ too many control channels

Page 20: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Fuzzy January 21, 2013 10 / 43

Fuzzy Array Dataflow Analysis

Introduces parameters for each lexmax involving dynamic behavior

Parameters represent dynamic solution of lexmax operation

Derives properties on parameters after dataflow analysis(using resolution)

Parametric result is exact

Parameters can be projected out to obtain approximate but staticdataflow

Main problem for deriving process networks:Introduces too many parameters⇒ too many control channels

Page 21: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis Fuzzy January 21, 2013 10 / 43

Fuzzy Array Dataflow Analysis

Introduces parameters for each lexmax involving dynamic behavior

Parameters represent dynamic solution of lexmax operation

Derives properties on parameters after dataflow analysis(using resolution)

Parametric result is exact

Parameters can be projected out to obtain approximate but staticdataflow

Main problem for deriving process networks:Introduces too many parameters⇒ too many control channels

Page 22: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Array Dataflow Analysis On Demand Parametric January 21, 2013 11 / 43

On Demand Parametric Array Dataflow Analysis

Similar to FADA:

Exact, possibly parametric, dataflow

Introduces parameters to represent dynamic behavior

But:

+ Parameters have a different meaning

+ Effect analyzed before parameters are introduced

+ All computations are performed directly on affine sets and maps

− Currently only supports dynamic conditions

Page 23: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 12 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 24: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 13 / 43

Representing Generic Dynamic Conditionswhile (1) {

sample = radioFrontend();

if ( t(state) ) {

D: state = detect(sample);

} else { /* ... */ }

}

Dynamic condition (t(state)) represented by filterFilter access relation(s):access to (virtual) array representing condition{

D

statement reading from filter array

(i)→ (S0

statement writing to filter array

(i)→ t0

filter array

(i))}

Filter value relation:values of filter array elements for which statement is executed{

D(i)→ (1) | i ≥ 0}

S0: t0 = t(state);

Page 25: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 13 / 43

Representing Generic Dynamic Conditionswhile (1) {

sample = radioFrontend();

if ( t(state) ) {

D: state = detect(sample);

} else { /* ... */ }

}

Dynamic condition (t(state)) represented by filterFilter access relation(s):access to (virtual) array representing condition{

D

statement reading from filter array

(i)→ (S0

statement writing to filter array

(i)→ t0

filter array

(i))}

Filter value relation:values of filter array elements for which statement is executed{

D(i)→ (1) | i ≥ 0}

S0: t0 = t(state);

Page 26: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 13 / 43

Representing Generic Dynamic Conditionswhile (1) {

sample = radioFrontend();

if ( t(state) ) {

D: state = detect(sample);

} else { /* ... */ }

}

Dynamic condition (t(state)) represented by filterFilter access relation(s):access to (virtual) array representing condition{

D

statement reading from filter array

(i)→ (S0

statement writing to filter array

(i)→ t0

filter array

(i))}

Filter value relation:values of filter array elements for which statement is executed{

D(i)→ (1) | i ≥ 0}

S0: t0 = t(state);

Page 27: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 13 / 43

Representing Generic Dynamic Conditionswhile (1) {

sample = radioFrontend();

if ( t(state) ) {

D: state = detect(sample);

} else { /* ... */ }

}

Dynamic condition (t(state)) represented by filterFilter access relation(s):access to (virtual) array representing condition{

D

statement reading from filter array

(i)→ (S0

statement writing to filter array

(i)→ t0

filter array

(i))}

Filter value relation:values of filter array elements for which statement is executed{

D(i)→ (1) | i ≥ 0}

S0: t0 = t(state);

Page 28: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 13 / 43

Representing Generic Dynamic Conditionswhile (1) {

sample = radioFrontend();

if ( t(state) ) {

D: state = detect(sample);

} else { /* ... */ }

}

Dynamic condition (t(state)) represented by filterFilter access relation(s):access to (virtual) array representing condition{

D

statement reading from filter array

(i)→ (S0

statement writing to filter array

(i)→ t0

filter array

(i))}

Filter value relation:values of filter array elements for which statement is executed{

D(i)→ (1) | i ≥ 0}

S0: t0 = t(state);

Page 29: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 13 / 43

Representing Generic Dynamic Conditionswhile (1) {

sample = radioFrontend();

if ( t(state) ) {

D: state = detect(sample);

} else { /* ... */ }

}

Dynamic condition (t(state)) represented by filterFilter access relation(s):access to (virtual) array representing condition{

D

statement reading from filter array

(i)→ (S0

statement writing to filter array

(i)→ t0

filter array

(i))}

Filter value relation:values of filter array elements for which statement is executed{

D(i)→ (1) | i ≥ 0}

S0: t0 = t(state);

Page 30: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 14 / 43

Representing Locally Static Affine ConditionsN1: n = f();

for (int k = 0; k < 100; ++k) {

M: m = g();

for (int i = 0; i < m; ++i)

for (int j = 0; j < n; ++j)

A: a[j][i] = g();

N2: n = f();

}

Values of m and n not changed inside i and j loops⇒ locally static affine loop conditions

Filter access relations:{A(k , i, j)→ (M(k)→ m())

}{A(0, i, j)→ (N1()→ n())

}∪

{A(k , i, j)→ (N2(k − 1)→ n()) | k ≥ 1

}Filter value relation:{ A(k , i, j)→ (m, n) | 0 ≤ k ≤ 99 ∧ 0 ≤ i < m ∧ 0 ≤ j < n }

Note: filter access relations exploit (static) dataflow analysis on m and n

Page 31: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Dynamic Conditions January 21, 2013 14 / 43

Representing Locally Static Affine ConditionsN1: n = f();

for (int k = 0; k < 100; ++k) {

M: m = g();

for (int i = 0; i < m; ++i)

for (int j = 0; j < n; ++j)

A: a[j][i] = g();

N2: n = f();

}

Values of m and n not changed inside i and j loops⇒ locally static affine loop conditions

Filter access relations:{A(k , i, j)→ (M(k)→ m())

}{A(0, i, j)→ (N1()→ n())

}∪

{A(k , i, j)→ (N2(k − 1)→ n()) | k ≥ 1

}Filter value relation:{ A(k , i, j)→ (m, n) | 0 ≤ k ≤ 99 ∧ 0 ≤ i < m ∧ 0 ≤ j < n }

Note: filter access relations exploit (static) dataflow analysis on m and n

Page 32: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization January 21, 2013 15 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 33: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Overview January 21, 2013 16 / 43

Overview

Dataflow analysis performed for each read access (sink) separatelyPotential sources considered from closest to furthest

I number of shared loop iterators `I textual order

For each lexmax operationI is it possible for potential source not to execute when sink is executed?

(based on filters)I if so, parametrize lexmax problem

Page 34: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Representation January 21, 2013 17 / 43

Parametrizationstate = 0;

while (1) {

sample = radioFrontend();

if (t( state )) {

D: state = detect(sample);

} else {

C: decode(sample, &state, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

Memory based dependences: DmemC ,P =

{S0(i)→ D(i′) | 0 ≤ i′ < i

}At ` = 1: M = Dmem

C ,P ∩{S0(i)→ D(i)

}= ∅

At ` = 0: M ={S0(i)→ D(i′) | 0 ≤ i′ < i

}Potential source D(i′) may not have executed even if sink S0(i) is executed⇒ parametrization required

sink C

potential source P

Page 35: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Representation January 21, 2013 17 / 43

Parametrizationstate = 0;

while (1) {

sample = radioFrontend();

if (t( state )) {

D: state = detect(sample);

} else {

C: decode(sample, &state, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

Memory based dependences: DmemC ,P =

{S0(i)→ D(i′) | 0 ≤ i′ < i

}At ` = 1: M = Dmem

C ,P ∩{S0(i)→ D(i)

}= ∅

At ` = 0: M ={S0(i)→ D(i′) | 0 ≤ i′ < i

}Potential source D(i′) may not have executed even if sink S0(i) is executed⇒ parametrization required

sink C

potential source P

Page 36: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Representation January 21, 2013 17 / 43

Parametrizationstate = 0;

while (1) {

sample = radioFrontend();

if (t( state )) {

D: state = detect(sample);

} else {

C: decode(sample, &state, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

Memory based dependences: DmemC ,P =

{S0(i)→ D(i′) | 0 ≤ i′ < i

}At ` = 1: M = Dmem

C ,P ∩{S0(i)→ D(i)

}= ∅

At ` = 0: M ={S0(i)→ D(i′) | 0 ≤ i′ < i

}Potential source D(i′) may not have executed even if sink S0(i) is executed⇒ parametrization required

sink C

potential source P

Page 37: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Representation January 21, 2013 18 / 43

Parameter Representation

Original:M =

{S0(i)→ D(i′) | 0 ≤ i′ < i

}After parameter introduction:

M′ ={S0(i)→ D(λP

C(i)) | 0 ≤ λPC(i) < i ∧ βP

C(i) = 1}

⇒ lexmax M′ = M′

Meaning of the parameters:

λPC(k): last executed iteration of Dmem

C ,P (k)

βPC(k): any iteration of Dmem

C ,P (k) is executed

Note: FADA introduces separate set of parameters for each lexmaxNote: λP

C(k) and βPC(k) depend on k, but dependence can be kept implicit

⇒ λPC and βP

C

Page 38: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Representation January 21, 2013 18 / 43

Parameter Representation

Original:M =

{S0(i)→ D(i′) | 0 ≤ i′ < i

}After parameter introduction:

M′ ={S0(i)→ D(λP

C(i)) | 0 ≤ λPC(i) < i ∧ βP

C(i) = 1}

⇒ lexmax M′ = M′

Meaning of the parameters:

λPC(k): last executed iteration of Dmem

C ,P (k)

βPC(k): any iteration of Dmem

C ,P (k) is executed

Note: FADA introduces separate set of parameters for each lexmaxNote: λP

C(k) and βPC(k) depend on k, but dependence can be kept implicit

⇒ λPC and βP

C

Page 39: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 19 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 40: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 19 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affine

dimensions that can only attain a single value (for a given value of k)dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 41: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 19 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affine

for (i = 0; i < 100; ++i)

if (t())

for (j = 0; j < 100; ++j)

A: a = t();

B: b = a;

M ={B()→ A(i, j) | 0 ≤ i, j < 100

}

M′ ={B()→ A(λ0, j) | 0 ≤ λ0, j < 100 ∧ β = 1

}lexmax M′ =

{B()→ A(λ0, 99) | 0 ≤ λ0 < 100 ∧ β = 1

}

dimensions that can only attain a single value (for a given value of k)dimensions before `⇒ replace β by σ: the number of implicitly equal shared iterators

β = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 42: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 19 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affine

for (i = 0; i < 100; ++i)

if (t())

for (j = 0; j < 100; ++j)

A: a = t();

B: b = a;

M ={B()→ A(i, j) | 0 ≤ i, j < 100

}M′ =

{B()→ A(λ0, j) | 0 ≤ λ0, j < 100 ∧ β = 1

}

lexmax M′ ={B()→ A(λ0, 99) | 0 ≤ λ0 < 100 ∧ β = 1

}

dimensions that can only attain a single value (for a given value of k)dimensions before `⇒ replace β by σ: the number of implicitly equal shared iterators

β = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 43: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 19 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affine

for (i = 0; i < 100; ++i)

if (t())

for (j = 0; j < 100; ++j)

A: a = t();

B: b = a;

M ={B()→ A(i, j) | 0 ≤ i, j < 100

}M′ =

{B()→ A(λ0, j) | 0 ≤ λ0, j < 100 ∧ β = 1

}lexmax M′ =

{B()→ A(λ0, 99) | 0 ≤ λ0 < 100 ∧ β = 1

}

dimensions that can only attain a single value (for a given value of k)dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 44: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 19 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)

dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 45: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 20 / 43

Introducing as few Parameters as possibleDimensions that can only attain a single value

for (int k = 0; k < 100; ++k) {

N: N = f();

M: M = g();

for (int i = 0; i < N; ++i)

for (int j = 0; j < M; ++j)

A: a[i][j] = i + j;

for (int i = 0; i < N; ++i)

for (int j = 0; j < M; ++j)

H: h(i, j, a[i][j]);

}

DmemH,A =

{H(k , i, j)→ A(k ′, i, j) | k ′ ≤ k

}λ1(k , i, j) = i

λ2(k , i, j) = j⇒ no need to introduce λ1 and λ2

a

Page 46: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 21 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)

dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 47: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 21 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 48: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 22 / 43

Introducing as few Parameters as possibleDimensions before `

for (int k = 0; k < 100; ++k) {

N: N = f();

M: M = g();

for (int i = 0; i < N; ++i)

for (int j = 0; j < M; ++j)

A: a[i][j] = i + j;

for (int i = 0; i < N; ++i)

for (int j = 0; j < M; ++j)

H: h(i, j, a[i][j]);

}

At ` = 1:M =

{H(k , i, j)→ A(k , i, j)

}⇒ no need to introduce λ0 (yet) at ` = 1

Note: all sinks are accounted for at ` = 1⇒ no need to consider ` = 0 and λ0 not needed at all

a

Page 49: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 22 / 43

Introducing as few Parameters as possibleDimensions before `

for (int k = 0; k < 100; ++k) {

N: N = f();

M: M = g();

for (int i = 0; i < N; ++i)

for (int j = 0; j < M; ++j)

A: a[i][j] = i + j;

for (int i = 0; i < N; ++i)

for (int j = 0; j < M; ++j)

H: h(i, j, a[i][j]);

}

At ` = 1:M =

{H(k , i, j)→ A(k , i, j)

}⇒ no need to introduce λ0 (yet) at ` = 1Note: all sinks are accounted for at ` = 1⇒ no need to consider ` = 0 and λ0 not needed at all

a

Page 50: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 23 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)dimensions before `

⇒ replace β by σ: the number of implicitly equal shared iteratorsβ = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 51: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 23 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)dimensions before `⇒ replace β by σ: the number of implicitly equal shared iterators

β = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 52: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 23 / 43

Introducing as few Parameters as possible

In principle, the number of elements in λ is equal to the number of iteratorsHowever, in many cases, we can avoid introducing some of those elements

dimensions inside innermost condition that is not static affinedimensions that can only attain a single value (for a given value of k)dimensions before `⇒ replace β by σ: the number of implicitly equal shared iterators

β = 1 → σ ≥ `

β = 0 → σ < `

I when moving to ` − 1F introduce additional parameter λ`−1 (if needed)F make implicit equality explicit

I at the end of the dataflow analysisσ ≥ `≤ → β = 1σ < `≤ → β = 0

(`≤: smallest ` for which parametrization was applied)λ(k) and β(k) now refer to last execution of D(k)(D: result of projecting out parameters from final dataflow relation)

Page 53: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 24 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 54: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 24 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 55: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 24 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 56: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 25 / 43

Filter on source contradicts F

while (1) {

N: n = f();

a = g();

if (n < 100)

H: a = h();

if (n > 200)

T: t( a );

}

` = 1

Potential source filter access relation{H(i)→ (N(i)→ n)

}Potential source filter value relation{

H(i)→ (n) | i ≥ 0 ∧ n < 100}

Sink filter access relation{T(i)→ (N(i)→ n)

}Sink filter value relation{

T(i)→ (n) | i ≥ 0 ∧ n > 200}

potential source

sink

same filter element

contradiction

Page 57: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 25 / 43

Filter on source contradicts F

while (1) {

N: n = f();

a = g();

if (n < 100)

H: a = h();

if (n > 200)

T: t( a );

}

` = 1

Potential source filter access relation{H(i)→ (N(i)→ n)

}Potential source filter value relation{

H(i)→ (n) | i ≥ 0 ∧ n < 100}

Sink filter access relation{T(i)→ (N(i)→ n)

}Sink filter value relation{

T(i)→ (n) | i ≥ 0 ∧ n > 200}

potential source

sink

same filter element

contradiction

Page 58: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 25 / 43

Filter on source contradicts F

while (1) {

N: n = f();

a = g();

if (n < 100)

H: a = h();

if (n > 200)

T: t( a );

}

` = 1

Potential source filter access relation{H(i)→ (N(i)→ n)

}Potential source filter value relation{

H(i)→ (n) | i ≥ 0 ∧ n < 100}

Sink filter access relation{T(i)→ (N(i)→ n)

}Sink filter value relation{

T(i)→ (n) | i ≥ 0 ∧ n > 200}

potential source

sink

same filter element

contradiction

Page 59: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 26 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 60: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 26 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop

6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 61: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 27 / 43

Filter on source contradicts F ′

N: n = f();

if (n < 100)

H: a = h();

if (n < 200)

H2: a = h2();

T: t( a );

}

lexmaxU

M

M ={T()→ H()

}U =

{T() | σH2 < 0

}

Updated sink filter access relation{T(i)→ (N(i)→ n)

}Updated sink filter value relation{

T(i)→ (n) | i ≥ 0 ∧ n ≥ 200}

potential source

sink

H2 not executed

Page 62: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 27 / 43

Filter on source contradicts F ′

N: n = f();

if (n < 100)

H: a = h();

if (n < 200)

H2: a = h2();

T: t( a );

}

lexmaxU

M

M ={T()→ H()

}U =

{T() | σH2 < 0

}

Updated sink filter access relation{T(i)→ (N(i)→ n)

}Updated sink filter value relation{

T(i)→ (n) | i ≥ 0 ∧ n ≥ 200}

potential source

sinkH2 not executed

Page 63: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 27 / 43

Filter on source contradicts F ′

N: n = f();

if (n < 100)

H: a = h();

if (n < 200)

H2: a = h2();

T: t( a );

}

lexmaxU

M

M ={T()→ H()

}U =

{T() | σH2 < 0

}Updated sink filter access relation{

T(i)→ (N(i)→ n)}

Updated sink filter value relation{T(i)→ (n) | i ≥ 0 ∧ n ≥ 200

}

potential source

sinkH2 not executed

Page 64: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 28 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop

6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 65: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 28 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 66: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 29 / 43

Filter on source implied by F

while (1) {

N: n = f();

a = g();

if (n < 200)

H: a = h();

if (n < 100)

T: t( a );

}

` = 1

Potential source filter access relation{H(i)→ (N(i)→ n)

}Potential source filter value relation{

H(i)→ (n) | i ≥ 0 ∧ n < 200}

Sink filter access relation{T(i)→ (N(i)→ n)

}Sink filter value relation{

T(i)→ (n) | i ≥ 0 ∧ n < 100}

potential source

sink

Page 67: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 30 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 68: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 30 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop

8 Parametrize M

Page 69: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 31 / 43

Filter on source implied by F ′

N: n = f();

if (n < 200)

H: a = h();

if (n > 100)

H2: a = h2();

T: t( a );

}

lexmaxU

M

M ={T()→ H()

}U =

{T() | σH2 < 0

}Updated sink filter access relation{

T(i)→ (N(i)→ n)}

Updated sink filter value relation{T(i)→ (n) | i ≥ 0 ∧ n ≤ 100

}

potential source

sink

Page 70: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 32 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop

8 Parametrize M

Page 71: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Introduction January 21, 2013 32 / 43

When to Introduce ParametersSink CPotential source PSubset of sink iteration UMapping to potential source iterations M

Computing

(U′,D) = lexmaxU

M

1 No filter on source⇒ stop (no parametrization required)

2 Let F be the filter on the sink3 Filter on source contradicts F⇒ replace M by empty relation and stop

4 Let F ′ be equal to F updated with information from other sources5 Filter on source contradicts F ′

⇒ replace M by empty relation and stop6 Filter on source implied by F⇒ stop (no parametrization required)

7 Filter on source implied by F ′

⇒ parametrize D and stop8 Parametrize M

Page 72: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Additional Constraints January 21, 2013 33 / 43

Additional Constraints on Parameters

Some source iterations are definitely executed⇒ λ no later than definitely executed iterations

Eliminate (some) conflicts with other parameters

state = 0;

while (1) {

sample = radioFrontend();

if (t( state )) {

D: state = detect(sample);

} else {

C: decode(sample, &state, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

⇒ λC0(i) and λD0(i) cannot both be smaller than i − 1

Page 73: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Parametrization Additional Constraints January 21, 2013 33 / 43

Additional Constraints on Parameters

Some source iterations are definitely executed⇒ λ no later than definitely executed iterations

Eliminate (some) conflicts with other parameters

state = 0;

while (1) {

sample = radioFrontend();

if (t( state )) {

D: state = detect(sample);

} else {

C: decode(sample, &state, &value0);

value1 = processSample0(value0);

processSample1(value1);

}

}

⇒ λC0(i) and λD0(i) cannot both be smaller than i − 1

Page 74: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Related Work January 21, 2013 34 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 75: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Related Work January 21, 2013 35 / 43

Interaction with Libraries

clang GMP

isl NTL PolyLib

pet barvinok

PPCG

isa iscc

HiPEAC 2013

IMPACT 2012

IMPACT 2011

isl: manipulates parametric affine sets and relationsbarvinok: counts elements in parametric affine sets and relationspet: extracts polyhedral model from clang ASTisa: prototype tool set including

derivation of process networks (with On Demand Parametric ADA)equivalence checker

PPCG: Polyhedral Parallel Code Generator

Page 76: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Related Work January 21, 2013 35 / 43

Interaction with Libraries

clang GMP

isl NTL PolyLib

pet barvinok

PPCG isa isccHiPEAC 2013

IMPACT 2012

IMPACT 2011

isl: manipulates parametric affine sets and relationsbarvinok: counts elements in parametric affine sets and relationspet: extracts polyhedral model from clang ASTisa: prototype tool set including

derivation of process networks (with On Demand Parametric ADA)equivalence checker

PPCG: Polyhedral Parallel Code Generator

Page 77: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Related Work January 21, 2013 36 / 43

Related Work

Fuzzy Array Dataflow Analysis⇒ only known publicly available implementation: fadatool

Pugh et al. (1994) and Maslov (1995) produce approximate resultsCollard et al. (1999)

I handle unstructured programsI only collect constraintsI assume Omega can solve the constraints, but it cannot

Page 78: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 37 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 79: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 38 / 43

Experimental Resultsinput da fadatool fadatool -s

time p d time p l time p lExample from paper 0.01s 0 5 0.01s 6 6 0.01s 6 6Example from slides 0.01s 4 9 0.01s 6 16 incorrectfuzzy4 0.06s 3 9 0.02s 4 9 0.01s 0 9for1 0.02s 2 3 0.01s 4 46 0.02s 2 3for2 0.03s 2 3 0.09s 12 5k 0.04s 4 3for3 0.04s 2 3 42s 24 1M 0.08s 6 3for4 0.06s 2 3 0.16s 8 3for5 0.08s 2 3 0.25s 10 3for6 0.14s 2 3 0.42s 12 3cascade if1 0.02s 2 3 0.01s 2 4 0.01s 2 4cascade if2 0.02s 2 10 0.02s 4 52 0.02s 2 8cascade if3 0.03s 2 22 0.03 6 723 0.36s 3 16cascade if4 0.02s 2 10 0.17s 8 9k 1m 4 28while1 0.01s 0 4 0.00s 1 4 0.01s 0 4while2 0.03s 3 4 0.01s 5 6 incorrectif var 0.03s 4 3 0.01s 2 8 0.01s 2 4if while 0.04s 2 14 0.01s 5 58 0.02s 4 58if2 0.02s 2 2 0.46s 12 29k 0.04s 4 2

Page 80: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 38 / 43

Experimental Resultsinput da fadatool fadatool -s

time p d time p l time p lExample from paper 0.01s 0 5 0.01s 6 6 0.01s 6 6Example from slides 0.01s 4 9 0.01s 6 16 incorrectfuzzy4 0.06s 3 9 0.02s 4 9 0.01s 0 9for1 0.02s 2 3 0.01s 4 46 0.02s 2 3for2 0.03s 2 3 0.09s 12 5k 0.04s 4 3for3 0.04s 2 3 42s 24 1M 0.08s 6 3for4 0.06s 2 3 0.16s 8 3for5 0.08s 2 3 0.25s 10 3for6 0.14s 2 3 0.42s 12 3cascade if1 0.02s 2 3 0.01s 2 4 0.01s 2 4cascade if2 0.02s 2 10 0.02s 4 52 0.02s 2 8cascade if3 0.03s 2 22 0.03 6 723 0.36s 3 16cascade if4 0.02s 2 10 0.17s 8 9k 1m 4 28while1 0.01s 0 4 0.00s 1 4 0.01s 0 4while2 0.03s 3 4 0.01s 5 6 incorrectif var 0.03s 4 3 0.01s 2 8 0.01s 2 4if while 0.04s 2 14 0.01s 5 58 0.02s 4 58if2 0.02s 2 2 0.46s 12 29k 0.04s 4 2

Page 81: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 38 / 43

Experimental Resultsinput da fadatool fadatool -s

time p d time p l time p lExample from paper 0.01s 0 5 0.01s 6 6 0.01s 6 6Example from slides 0.01s 4 9 0.01s 6 16 incorrectfuzzy4 0.06s 3 9 0.02s 4 9 0.01s 0 9for1 0.02s 2 3 0.01s 4 46 0.02s 2 3for2 0.03s 2 3 0.09s 12 5k 0.04s 4 3for3 0.04s 2 3 42s 24 1M 0.08s 6 3for4 0.06s 2 3 0.16s 8 3for5 0.08s 2 3 0.25s 10 3for6 0.14s 2 3 0.42s 12 3cascade if1 0.02s 2 3 0.01s 2 4 0.01s 2 4cascade if2 0.02s 2 10 0.02s 4 52 0.02s 2 8cascade if3 0.03s 2 22 0.03 6 723 0.36s 3 16cascade if4 0.02s 2 10 0.17s 8 9k 1m 4 28while1 0.01s 0 4 0.00s 1 4 0.01s 0 4while2 0.03s 3 4 0.01s 5 6 incorrectif var 0.03s 4 3 0.01s 2 8 0.01s 2 4if while 0.04s 2 14 0.01s 5 58 0.02s 4 58if2 0.02s 2 2 0.46s 12 29k 0.04s 4 2

Page 82: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 39 / 43

Larger Example — Inputfor (j = 1; j <= frame; j++) {

initialize(frame, n_act, &scor, &act, &ps, cmp,

&s, &n, &idx, &mixw_cb, &cmp_l, &n_act_l, &act_l, &scor_l);

for (i = 0; i < n; ++i) {

initFeatBuff(i, &feat_buff , &featbuf_l);

copyFeat(&s, frame, i, idx, &s);

mgau_dist(&s, frame, i, &featbuf_l , &s);

hist_l = mgau_norm(&s, frame, i);

if (mixw_cb >= 1) {

if (cmp_l >= 1)

get_scors_4b_all(&s, i, hist_l, &scor_l, &scor_l);

else

get_scors_4b(&s, i, hist_l, n_act_l, &act_l, &scor_l, &scor_l);

} else {

if (cmp_l >= 1)

get_scors_8b_all(&s, i, hist_l, &scor_l, &scor_l);

else

get_scors_8b(&s, i, hist_l, n_act_l, &act_l, &scor_l, &scor_l);

}

write_scor(&scor_l, &scor_l);

}

}

Page 83: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 40 / 43

Larger Example — Dataflow Graph

initialize

initFeatBuff

n

copyFeat

idx n s

mgau_dist

n

mgau_norm

n

get_scors_4b_all

mixw_cbcmp_l scor_l n

get_scors_4b

mixw_cb cmp_ln_act_l act_l scor_l n

get_scors_8b_all

mixw_cbcmp_l scor_l n

get_scors_8b

mixw_cb cmp_l n_act_l act_l scor_l n

write_scor

n

n

featbuf_l

n idx

s s

n

s

s

s s s

n

hist_l

hist_l hist_l hist_l

n mixw_cbcmp_l

scor_l beta_1

n mixw_cbcmp_ln_act_lact_l

scor_lbeta_2

n mixw_cbcmp_l

scor_l beta_3

n mixw_cbcmp_ln_act_lact_l

scor_l beta_4

scor_l

scor_l scor_l scor_l

n scor_l: 0scor_l: 0scor_l: 0

Page 84: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Experimental Results January 21, 2013 41 / 43

Larger Example — (Partial) Process Networkinitialize

out_8ND_0 out_7ND_0out_7ND_0 out_7ND_0out_7ND_0out_7ND_0 out_7ND_0out_7ND_0 out_7ND_0out_7ND_0out_9ND_0 out_9ND_0out_9ND_0 out_9ND_0out_10ND_0 out_10ND_0out_10ND_0 out_10ND_0out_11ND_0 out_11ND_0out_6ND_0 out_12ND_0 out_12ND_0out_13ND_0 out_13ND_0out_13ND_0 out_13ND_0

in_4ND_2

ED_0 in_0ND_1

ED_1

in_0ND_2

ED_2

in_0ND_3

ED_3

in_0ND_4

ED_4

in_0ND_5

ED_5

in_0ND_6

ED_6

in_0ND_7

ED_7

in_0ND_8

ED_8

in_0ND_9

ED_9

in_1ND_5

ED_10

in_1ND_6

ED_11

in_1ND_7

ED_12

in_1ND_8

ED_13

in_2ND_5

ED_14

in_2ND_6

ED_15

in_2ND_7

ED_16

in_2ND_8

ED_17

in_6ND_6

ED_23

in_6ND_8

ED_24

in_1ND_2

ED_26

in_7ND_6

ED_37

in_7ND_8

ED_38

in_6ND_5

ED_40

in_8ND_6

ED_42

in_6ND_7

ED_44

in_8ND_8

ED_46

initFeatBuff

out_3ND_1

in_4ND_3

ED_35

copyFeat

out_5ND_2

in_1ND_2 in_1ND_3

ED_28 mgau_dist

out_5ND_3 out_5ND_3 out_5ND_3 out_5ND_3out_5ND_3 out_5ND_3

ED_27

in_1ND_4

ED_29

in_3ND_5

ED_30

in_3ND_6

ED_31

in_3ND_7

ED_32

in_3ND_8

ED_33

mgau_norm

out_4ND_4 out_4ND_4out_4ND_4 out_4ND_4

in_5ND_5

ED_19

in_5ND_6

ED_20

in_5ND_7

ED_21

in_5ND_8

ED_22

get_scors_4b_all

out_7ND_5 dc0_ND_5_b

in_6ND_5

in_3ND_9

ED_48

dc0_ND_9_b

CED_53

get_scors_4b

out_9ND_6 dc0_ND_6_b

in_8ND_6

in_4ND_9

ED_49

dc1_ND_9_b

CED_54

get_scors_8b_all

out_7ND_7 dc0_ND_7_b

in_6ND_7

in_5ND_9

ED_50

dc2_ND_9_b

CED_55

get_scors_8b

out_9ND_8dc0_ND_8_b

in_8ND_8

in_1ND_9

ED_51dc3_ND_9_b

CED_56

write_scor

out_2ND_9 out_2ND_9out_2ND_9 out_2ND_9

in_1ND_9 in_1ND_9 in_1ND_9

ED_41 ED_43ED_45 ED_47

Page 85: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Conclusion January 21, 2013 42 / 43

Outline1 Motivation

General MotivationOur Motivation

2 Array Dataflow AnalysisStandardFuzzyOn Demand Parametric

3 Dynamic Conditions4 Parametrization

OverviewRepresentationIntroductionAdditional Constraints

5 Related Work6 Experimental Results7 Conclusion

Page 86: On Demand Parametric Array Dataflow Analysis · 6 Experimental Results 7 Conclusion. Motivation January 21, 2013 3 / 43 Outline 1 Motivation General Motivation Our Motivation 2 Array

Conclusion January 21, 2013 43 / 43

Conclusion

Conclusions

Dynamic behavior represented using “filters”

Exact, possibly parametric, dataflow analysis

Prototype implementation in isaSimilar to FADA, but

I Parameters have a different meaningI Effect analyzed before parameters are introducedI All computations are performed directly on affine sets and maps

Future work

Tighter integration into pet