• No results found

Integer set coalescing for polyhedral compilation

N/A
N/A
Protected

Academic year: 2021

Share "Integer set coalescing for polyhedral compilation"

Copied!
114
0
0

Loading.... (view fulltext now)

Full text

(1)

October 21, 2014 1 / 28

Integer Set Coalescing for Polyhedral Compilation

Sven Verdoolaege

INRIA and KU Leuven

(2)

October 21, 2014 2 / 28

Outline

1 Introduction and Motivation

Polyhedal Compilation The need for coalescing Traditional “Coalescing”

2 Coalescing inisl

Rational Cases

Constraints adjacent to inequality Constraints adjacent to equality Wrapping

Existentially Quantified Variables

(3)

Introduction and Motivation October 21, 2014 3 / 28

Outline

1 Introduction and Motivation

Polyhedal Compilation The need for coalescing Traditional “Coalescing”

2 Coalescing inisl Rational Cases

Constraints adjacent to inequality Constraints adjacent to equality Wrapping

Existentially Quantified Variables 3 Conclusions

(4)

Introduction and Motivation Polyhedal Compilation October 21, 2014 4 / 28

Polyhedral Compilation

program code polyhedral model

parser AST generator analysis and transformation for (i = 0; i <= N; ++ i) a[i] = ... for (i = 0; i <= N; ++ i) b[i] = f(a[N -i ]) for (i = 0; i <= N; ++ i) { a[i] = ... b[N -i] = f(a[i ]) }

(5)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(0,0);S(0,1);S(1,0);S(1,1);T(0);T(1)} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j<2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j <2;T(k)→(5+k) :0≤k <2}

(6)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(0,0);S(0,1);S(1,0);S(1,1);T(0);T(1)}

Access relations(accessed array elements; W : write, R: read) W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1);

S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(7)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(0,0);S(0,1);S(1,0);S(1,1);T(0);T(1)} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)}

Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(8)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(0,0);S(0,1);S(1,0);S(1,1);T(0);T(1)} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(9)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(0,0);S(0,1);S(1,0);S(1,1);T(0);T(1)} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(10)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(0,0);S(0,1);S(1,0);S(1,1);T(0);T(1)} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(11)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(12)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W= {S(0,0) → A(0);S(0,1) → A(1);S(1,0) → A(1); S(1,1) → A(2)}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(13)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W= {S(i,j) → A(i+j) :0≤i <2∧0≤j<2}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(14)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W= {S(i,j) → A(i+j) :0≤i <2∧0≤j<2}

R = {R() → A(2);T(0) → A(0);T(1) → A(1);T(1) → A(0)} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2}

{R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(15)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W = {S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

R = {R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} {R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(16)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W = {S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

R = {R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2}

{R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2}

(17)

Introduction and Motivation Polyhedal Compilation October 21, 2014 5 / 28

Polyhedral Model

R: h(A [2]); for ( int i = 0; i < 2; ++ i) for ( int j = 0; j < 2; ++ j) S: A[i + j] = f(i , j ); for ( int k = 0; k < 2; ++ k) T: g(A[k], A [0]); instance based compact representation

Instance set(set of statement instances)

I= {R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2} Access relations(accessed array elements; W : write, R: read)

W = {S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

R = {R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2} Schedule(execution order)

{R()→(0);S(0,0)→(1);S(0,1)→(2);S(1,0)→(3); S(1,1)→(4);T(0)→(5);T(1)→(6) }

{R();S(i,j) :0≤i <2∧0≤j <2;T(k) :0≤k <2; }

Constraints

“read off”, or

obtained through abstract interpretation

{S(i,j) → A(i+j) :0≤i <2∧0≤j <2}

{R() → A(2);T(k) → A(0) :0≤k <2;T(k) → A(k) :0≤k <2}

{R()→(0);S(i,j)→(1+2i+j) :0≤i,j<2;T(k)→(5+k) :0≤k <2} {R()→(0,0,0);S(i,j)→(1,i,j) :0≤i,j<2;T(k)→(2,k,0) :0≤k <2}

(18)

Introduction and Motivation The need for coalescing October 21, 2014 6 / 28

Equivalent Representations

extensive {S(0,0);S(0,1);S(1,0);S(1,1)} 4 = {S(i,j) : (i =0∧j =0) ∨ (i =0∧j =1) ∨ (i =1∧j =0) ∨ (i =1∧j =1)} intensive {S(i,j) :0≤i<2∧0≤j <2} 1 alternative {S(i,j) : (i =0∧0≤j<2) ∨ (i =1∧0≤j<2)} 2

In general, representation with fewerdisjunctsis preferred

(usually) occupies less memory

operations can be performed more efficiently

the outcome of some operations depends on chosen representation

I transitive closure approximation I AST generation

(19)

Introduction and Motivation The need for coalescing October 21, 2014 6 / 28

Equivalent Representations

extensive {S(0,0);S(0,1);S(1,0);S(1,1)} 4 = {S(i,j) : (i =0∧j =0) ∨ (i =0∧j =1) ∨ (i =1∧j =0) ∨ (i =1∧j =1)} intensive {S(i,j) :0≤i<2∧0≤j <2} 1 alternative {S(i,j) : (i =0∧0≤j<2) ∨ (i =1∧0≤j<2)} 2

In general, representation with fewerdisjunctsis preferred

(usually) occupies less memory

operations can be performed more efficiently

the outcome of some operations depends on chosen representation

I transitive closure approximation I AST generation

(20)

Introduction and Motivation The need for coalescing October 21, 2014 6 / 28

Equivalent Representations

extensive {S(0,0);S(0,1);S(1,0);S(1,1)} 4 = {S(i,j) : (i =0∧j =0) ∨ (i =0∧j =1) ∨ (i =1∧j =0) ∨ (i =1∧j =1)} intensive {S(i,j) :0≤i<2∧0≤j <2} 1 alternative {S(i,j) : (i =0∧0≤j<2) ∨ (i =1∧0≤j<2)} 2

In general, representation with fewerdisjunctsis preferred

(usually) occupies less memory

operations can be performed more efficiently

the outcome of some operations depends on chosen representation

I transitive closure approximation

I AST generation

(21)

Introduction and Motivation The need for coalescing October 21, 2014 7 / 28

Effect on AST Generation —

guide

Without coalescing

for ( int c0 = 1; c0 <= min (2 * M , N ); c0 += 1) S1 ( c0 );

for ( int c0 = max (1 , 2 * M + 1); c0 <= N; c0 += 1) S1 ( c0 ); for ( int c0 = N + 1; c0 <= 2 * N; c0 += 1) S2 ( c0 ); With coalescing for ( int c0 = 1; c0 <= N; c0 += 1) S1 ( c0 ); for ( int c0 = N + 1; c0 <= 2 * N; c0 += 1) S2 ( c0 );

(22)

Introduction and Motivation The need for coalescing October 21, 2014 8 / 28

Effect on AST Generation —

cholesky2

Without coalescing (fragment)

for ( int c0 = 1; c0 < 3 * M - 1; c0 += 3) { S3 (( c0 + 2) / 3); if (3 * M >= c0 + 8) { for ( int c1 = ( c0 + 5) / 3; c1 <= M; c1 += 1) { S6 (( c0 + 2) / 3, c1 ); for ( int c4 = ( c0 + 5) / 3; c4 < c1 ; c4 += 1) S5 (c4 , c1 , ( c0 + 2) / 3); } } else if ( c0 + 5 == 3 * M) S6 (M - 1, M ); }

With coalescing (fragment)

for ( int c0 = 1; c0 < 3 * M - 1; c0 += 3) { S3 (( c0 + 2) / 3); for ( int c1 = ( c0 + 5) / 3; c1 <= M; c1 += 1) { S6 (( c0 + 2) / 3, c1 ); for ( int c4 = ( c0 + 5) / 3; c4 < c1 ; c4 += 1) S5 (c4 , c1 , ( c0 + 2) / 3); } }

(23)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(24)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(25)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(26)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(27)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(28)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(29)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z≥0∧x+y ≥0}

(30)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

(31)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(32)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(33)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(34)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(35)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(36)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(37)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(38)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming

min{(x,y) → (z) :z≥0∧x+z ≥0∧x+y ≥0}

0

−y

−x

(39)

Introduction and Motivation The need for coalescing October 21, 2014 9 / 28

Causes of Splintering

Several operations on integer sets may introduce coalescing opportunities Projection

Subtraction

Parametric integer programming Union

(40)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 10 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hull H ofS

2 Remove integer elements not inS from H

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(41)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 10 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Remove integer elements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(42)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 10 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Remove integer elements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(43)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 10 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Removeintegerelements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(44)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 10 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Remove integer elements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(45)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 10 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Remove integer elements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients

Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(46)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 11 / 28

Effect on AST Generation —

covariance

Withislcoalescing (in this case same result as no coalescing)

for ( long c1 = n >= 1 ? (( n - 1) % 32) - n - 31 : 0; c1 <= (n >= 1 ? n - 1 : 0) ; c1 += 32) {

/* .. */ }

With convex hull based “coalescing”

for ( long c1 = 32 * floord ( 1073741839 * n -32749125633 , 68719476720) - 1073741792; c1 <= floord (715827882 * n + 357913941 , 1431655765) + 1073741823; c1 += 32) {

/* .. */ }

(47)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 12 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Remove integer elements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients

Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(48)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 12 / 28

Traditional “Coalescing”

Traditional method (e.g., in CLooG with original PolyLib backend)

1 Compute convex hullH ofS

2 Remove integer elements not inS fromH

⇒H\ (H\S)

Issues:

Convex hull may have exponential number of constraints We may be able to remove some of them, but we still need to compute them first.

Constraints of convex hull may have very large coefficients Convex hull is an operation on rational sets

⇒ mixture of operation on rational sets (convex hull) and integer sets (set subtraction)

⇒ in isl, convex hull operation not fully defined on sets with existentially quantified variables

(49)

Introduction and Motivation Traditional “Coalescing” October 21, 2014 13 / 28

AST Generation Times

Generation times onislAST generation test cases

islcoalescing 16.0s

no coalescing 16.3s

convex hull (FM) 24m00s

convex hull (wrapping) 6m40s

Note: islmay not have the most efficient convex hull implementation

(50)

Coalescing in isl October 21, 2014 14 / 28

Outline

1 Introduction and Motivation Polyhedal Compilation The need for coalescing Traditional “Coalescing” 2 Coalescing inisl

Rational Cases

Constraints adjacent to inequality Constraints adjacent to equality Wrapping

Existentially Quantified Variables

(51)

Coalescing in isl October 21, 2014 15 / 28

Coalescing in

isl

Coalescing inisl

never increases the total number of constraints

based on solving LP problems with same dimension as input set recognizes a set of patterns

(52)

Coalescing in isl Rational Cases October 21, 2014 16 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(53)

Coalescing in isl Rational Cases October 21, 2014 17 / 28

Constraint types

Given two disjuncts A and B

For each affine constraint t(x) ≥0 of A , determine its effect on B

min t(x)> −1 over B

⇒validconstraint max t(x)<0 over B

⇒separatingconstraint

special cases:

I t = −u − 1 with u(x) ≥ 0 a constraints of B ⇒ constraint isadjacent to an inequalityof B

I t(x) = −1 over B

⇒ constraint isadjacent to an equalityof B

otherwise (attains both positive and negative values over B)

⇒cutconstraint

Note: affine expression t(x) ≥0 has integer coefficients

(54)

Coalescing in isl Rational Cases October 21, 2014 17 / 28

Constraint types

Given two disjuncts A and B

For each affine constraint t(x) ≥0 of A , determine its effect on B

min t(x)> −1 over B

⇒validconstraint

max t(x)<0 over B

⇒separatingconstraint

special cases:

I t = −u − 1 with u(x) ≥ 0 a constraints of B ⇒ constraint isadjacent to an inequalityof B

I t(x) = −1 over B

⇒ constraint isadjacent to an equalityof B

otherwise (attains both positive and negative values over B)

⇒cutconstraint

Note: affine expression t(x) ≥0 has integer coefficients

(55)

Coalescing in isl Rational Cases October 21, 2014 17 / 28

Constraint types

Given two disjuncts A and B

For each affine constraint t(x) ≥0 of A , determine its effect on B

min t(x)> −1 over B

⇒validconstraint max t(x)<0 over B

⇒separatingconstraint

special cases:

I t = −u − 1 with u(x) ≥ 0 a constraints of B ⇒ constraint isadjacent to an inequalityof B

I t(x) = −1 over B

⇒ constraint isadjacent to an equalityof B

otherwise (attains both positive and negative values over B)

⇒cutconstraint

Note: affine expression t(x) ≥0 has integer coefficients

(56)

Coalescing in isl Rational Cases October 21, 2014 17 / 28

Constraint types

Given two disjuncts A and B

For each affine constraint t(x) ≥0 of A , determine its effect on B

min t(x)> −1 over B

⇒validconstraint max t(x)<0 over B

⇒separatingconstraint

special cases:

I t = −u − 1 with u(x) ≥ 0 a constraints of B ⇒ constraint isadjacent to an inequalityof B

I t(x) = −1 over B

⇒ constraint isadjacent to an equalityof B

otherwise (attains both positive and negative values over B)

⇒cutconstraint

Note: affine expression t(x) ≥0 has integer coefficients

(57)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(58)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(59)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(60)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(61)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(62)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(63)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(64)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(65)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(66)

Coalescing in isl Rational Cases October 21, 2014 18 / 28

Coalescing Cases

1 All constraints ofA are valid forB

⇒ dropB

2 NeitherA norB have separating

constraints and all cut constraints of

A are valid for the cut facets ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

5 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

11 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

13 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

15 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(67)

Coalescing in isl Constraints adjacent to inequality October 21, 2014 19 / 28

Coalescing Cases

3 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

5 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

11 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

13 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(68)

Coalescing in isl Constraints adjacent to inequality October 21, 2014 20 / 28

Constraint types

Given two disjuncts A and B

For each affine constraint t(x) ≥0 of A , determine its effect on B

min t(x)> −1 over B

⇒validconstraint max t(x)<0 over B

⇒separatingconstraint

special cases:

I t = −u − 1 with u(x) ≥ 0 a constraints of B ⇒ constraint isadjacent to an inequalityof B

I t(x) = −1 over B

⇒ constraint isadjacent to an equalityof B

otherwise (attains both positive and negative values over B)

⇒cutconstraint

Note: affine expression t(x) ≥0 has integer coefficients

(69)

Coalescing in isl Constraints adjacent to inequality October 21, 2014 20 / 28

Constraint types

Given two disjuncts A and B

For each affine constraint t(x) ≥0 of A , determine its effect on B

min t(x)> −1 over B

⇒validconstraint max t(x)<0 over B

⇒separatingconstraint special cases:

I t = −u − 1 with u(x) ≥ 0 a constraints of B ⇒ constraint isadjacent to an inequalityof B

I t(x) = −1 over B

⇒ constraint isadjacent to an equalityof B

otherwise (attains both positive and negative values over B)

⇒cutconstraint

Note: affine expression t(x) ≥0 has integer coefficients

(70)

Coalescing in isl Constraints adjacent to inequality October 21, 2014 21 / 28

Coalescing Cases

3 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

5 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

11 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

13 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

(71)

Coalescing in isl Constraints adjacent to inequality October 21, 2014 21 / 28

Coalescing Cases

3 single pair of adjacent inequalities

(other constraints valid)

⇒ replaceA ∪Bby set bounded by all valid constraints

5 A has single inequality adjacent to

inequality ofB (other constraints of

A are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 and adding valid

constraints ofB is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

7 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Result of replacing t(x) ≥0 by t(x) ≤ −1 is a subset ofB

⇒ replaceA ∪Bby set bounded by all valid constraints

9 A has single inequality adjacent to

equality ofB (other constraints ofA

are valid)

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

11 B extends beyondA by at most one

and all cut constraints ofB can be

wrapped around shifted facet ofA

to includeA

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints

(check final number of constraints does not increase)

13 A has equality adjacent to equality

ofB

Non-valid constraints ofB (except

t(x) ≤ −1) can be wrapped around t(x) ≥ −1 to includeA

Non-valid constraints ofA (except

t(x) ≥0) can be wrapped around

t(x) ≤0 to includeB

⇒ replaceA ∪Bby set bounded by all valid constraints and all wrapped constraints Constraint t(x) ≥0 valid: min t(x)> −1 separate: max t(x)<0 I adjacent to inequality: t = −u − 1 I adjacent to equality: t = −1 cut: otherwise

References

Related documents

The prosperity of family training in the Song Dynasty is the inevitable result of the development of family moral education.. It also has a profound influence on

In the face of the challenge of Western discourse hegemony, the collision of new media discourse form, the impact of diversified social thought, the crisis of the

logotipi pripreme na način da budu prepoznatljivi na svakoj „veličini ekrana“. No logotip je samo kap u moru prilagodbi kroz koje tvrtke moraju prolaziti kako bi ostale konkurentne na

Three features designed to reduce the frequency of ER visits were incorporated into CMS: 1) Guidance and instruction provided by nurse care managers at baseline and in follow-

Methods and Results—We performed an observational analysis of 37 634 ST-segment– elevation myocardial infarction patients treated at 372 US hospitals participating in the

If there is objective evidence that an impairment loss has been incurred, the amount of the loss is measured as the difference between the assets’s carrying amount and the

• Si la porte du Congélateur / réfrigérateur est équipée d’une poignée, ne tenez pas cette poignée lorsque vous déplacez l’appareil.. Dans le cas contraire cette

However, it has been shown that the mixed structure of tempered martensite and lower bainite (MA) that has been suggested in this investigation offers a good combination of