From 2a9823163866c3786a69335c2b09995e767dcbb8 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 16 Jan 2012 20:46:34 +0100 Subject: [PATCH] limit parameters in context to possible values of corresponding variables Signed-off-by: Sven Verdoolaege --- scan.cc | 75 +++++++++++++++++++++++++++++++++++--- tests/ceild.scop | 4 +- tests/conditional_assignment.scop | 45 ++++++++++++----------- tests/conditional_assignment2.scop | 49 +++++++++++++------------ tests/dec.scop | 4 +- tests/dec2.scop | 4 +- tests/dec3.scop | 4 +- tests/dec4.scop | 4 +- tests/empty_domain.scop | 2 +- tests/floord.scop | 2 +- tests/floord2.scop | 2 +- tests/implicit_condition.scop | 2 +- tests/inc.scop | 2 +- tests/inc2.scop | 2 +- tests/inc3.scop | 2 +- tests/iterator_declaration.scop | 2 +- tests/matmul.scop | 21 ++++++----- tests/max.scop | 4 +- tests/min.scop | 4 +- tests/min2.scop | 4 +- tests/mod.scop | 2 +- tests/piecewise.scop | 4 +- tests/piecewise2.scop | 4 +- tests/propagate.scop | 6 +-- tests/quasi_affine.scop | 6 +-- 25 files changed, 164 insertions(+), 96 deletions(-) diff --git a/scan.cc b/scan.cc index 34ed949..0d1d9b3 100644 --- a/scan.cc +++ b/scan.cc @@ -1,5 +1,6 @@ /* * Copyright 2011 Leiden University. All rights reserved. + * Copyright 2012 Ecole Normale Superieure. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -350,6 +351,43 @@ __isl_give isl_pw_aff *PetScan::extract_affine(ImplicitCastExpr *expr) return extract_affine(expr->getSubExpr()); } +static unsigned get_type_size(ValueDecl *decl) +{ + return decl->getASTContext().getIntWidth(decl->getType()); +} + +/* Bound parameter "pos" of "set" to the possible values of "decl". + */ +static __isl_give isl_set *set_parameter_bounds(__isl_take isl_set *set, + unsigned pos, ValueDecl *decl) +{ + unsigned width; + isl_int v; + + isl_int_init(v); + + width = get_type_size(decl); + if (decl->getType()->isUnsignedIntegerType()) { + set = isl_set_lower_bound_si(set, isl_dim_param, pos, 0); + isl_int_set_si(v, 1); + isl_int_mul_2exp(v, v, width); + isl_int_sub_ui(v, v, 1); + set = isl_set_upper_bound(set, isl_dim_param, pos, v); + } else { + isl_int_set_si(v, 1); + isl_int_mul_2exp(v, v, width - 1); + isl_int_sub_ui(v, v, 1); + set = isl_set_upper_bound(set, isl_dim_param, pos, v); + isl_int_neg(v, v); + isl_int_sub_ui(v, v, 1); + set = isl_set_lower_bound(set, isl_dim_param, pos, v); + } + + isl_int_clear(v); + + return set; +} + /* Extract an affine expression from the DeclRefExpr "expr". * * If the variable has been assigned a value, then we check whether @@ -1874,11 +1912,6 @@ static __isl_give isl_set *strided_domain(__isl_take isl_id *id, return isl_set_project_out(set, isl_dim_set, 0, 1); } -static unsigned get_type_size(ValueDecl *decl) -{ - return decl->getASTContext().getIntWidth(decl->getType()); -} - /* Assuming "cond" represents a simple bound on a loop where the loop * iterator "iv" is incremented (or decremented) by one, check if wrapping * is possible. @@ -3356,6 +3389,37 @@ error: return NULL; } +/* Bound all parameters in scop->context to the possible values + * of the corresponding C variable. + */ +static struct pet_scop *add_parameter_bounds(struct pet_scop *scop) +{ + int n; + + if (!scop) + return NULL; + + n = isl_set_dim(scop->context, isl_dim_param); + for (int i = 0; i < n; ++i) { + isl_id *id; + ValueDecl *decl; + + id = isl_set_get_dim_id(scop->context, isl_dim_param, i); + decl = (ValueDecl *) isl_id_get_user(id); + isl_id_free(id); + + scop->context = set_parameter_bounds(scop->context, i, decl); + + if (!scop->context) + goto error; + } + + return scop; +error: + pet_scop_free(scop); + return NULL; +} + /* Construct a pet_scop from the given function. */ struct pet_scop *PetScan::scan(FunctionDecl *fd) @@ -3371,6 +3435,7 @@ struct pet_scop *PetScan::scan(FunctionDecl *fd) scop = scan(stmt); scop = pet_scop_detect_parameter_accesses(scop); scop = scan_arrays(scop); + scop = add_parameter_bounds(scop); scop = pet_scop_gist(scop, value_bounds); return scop; diff --git a/tests/ceild.scop b/tests/ceild.scop index 31087bb..2551d02 100644 --- a/tests/ceild.scop +++ b/tests/ceild.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i] : 3i >= N and 2i <= -2 + N }' + domain: '[N] -> { S_0[i] : 2i <= -2 + N and 3i >= N }' schedule: '[N] -> { S_0[i] -> [0, i] }' body: type: binary diff --git a/tests/conditional_assignment.scop b/tests/conditional_assignment.scop index e333ba7..bb02d96 100644 --- a/tests/conditional_assignment.scop +++ b/tests/conditional_assignment.scop @@ -1,4 +1,5 @@ -context: '[N, M] -> { : N >= 0 and M >= 0 }' +context: '[N, M] -> { : N >= 0 and M >= 0 and N <= 2147483647 and M <= 2147483647 + }' arrays: - context: '[M, N] -> { : N >= 0 and M >= 0 }' extent: '[N, M] -> { in1[i0, i1] : i0 >= 0 and i1 >= 0 and i0 <= -1 + N and i1 <= @@ -19,29 +20,29 @@ arrays: element_type: int statements: - line: 21 - domain: '[N] -> { S_0[i] : i >= 0 and i <= -1 + N }' + domain: '[N, M] -> { S_0[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_0[i] -> [0, i, 0] }' body: type: binary operation: = arguments: - type: access - relation: '[N] -> { S_0[i] -> m[] }' + relation: '[N, M] -> { S_0[i] -> m[] }' read: 0 write: 1 - type: binary operation: + arguments: - type: access - relation: '[N] -> { S_0[i] -> [i] }' + relation: '[N, M] -> { S_0[i] -> [i] }' read: 1 write: 0 - type: access - relation: '[N] -> { S_0[i] -> [1] }' + relation: '[N, M] -> { S_0[i] -> [1] }' read: 1 write: 0 - line: 23 - domain: '[M, N] -> { S_1[i, j] : i >= 0 and i <= -1 + N and j >= 0 and j <= -1 + + domain: '[N, M] -> { S_1[i, j] : j >= 0 and i >= 0 and i <= -1 + N and j <= -1 + M }' schedule: '[M, N] -> { S_1[i, j] -> [0, i, 1, j] }' body: @@ -49,7 +50,7 @@ statements: operation: = arguments: - type: access - relation: '[M, N] -> { S_1[i, j] -> m[] }' + relation: '[N, M] -> { S_1[i, j] -> m[] }' read: 0 write: 1 - type: call @@ -59,15 +60,15 @@ statements: name: h arguments: - type: access - relation: '[M, N] -> { S_1[i, j] -> m[] }' + relation: '[N, M] -> { S_1[i, j] -> m[] }' read: 1 write: 0 - type: access - relation: '[M, N] -> { S_1[i, j] -> in1[i, j] }' + relation: '[N, M] -> { S_1[i, j] -> in1[i, j] }' read: 1 write: 0 - line: 24 - domain: '[N] -> { S_2[i] : i >= 0 and i <= -1 + N }' + domain: '[N, M] -> { S_2[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_2[i] -> [0, i, 2] }' body: type: call @@ -77,37 +78,37 @@ statements: name: h arguments: - type: access - relation: '[N] -> { S_2[i] -> m[] }' + relation: '[N, M] -> { S_2[i] -> m[] }' read: 1 write: 0 - type: access - relation: '[N] -> { S_2[i] -> A[i, o1] }' + relation: '[N, M] -> { S_2[i] -> A[i, o1] }' read: 0 write: 1 - line: 26 - domain: '{ S_3[] }' + domain: '[N, M] -> { S_3[] }' schedule: '{ S_3[] -> [1] }' body: type: binary operation: = arguments: - type: access - relation: '{ S_3[] -> A[5, 6] }' + relation: '[N, M] -> { S_3[] -> A[5, 6] }' read: 0 write: 1 - type: access - relation: '{ S_3[] -> [0] }' + relation: '[N, M] -> { S_3[] -> [0] }' read: 1 write: 0 - line: 28 - domain: '[N] -> { S_4[i] : i >= 0 and i <= -1 + N }' + domain: '[N, M] -> { S_4[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_4[i] -> [2, i] }' body: type: binary operation: = arguments: - type: access - relation: '[N] -> { S_4[i] -> C[i] }' + relation: '[N, M] -> { S_4[i] -> C[i] }' read: 0 write: 1 - type: ternary @@ -119,20 +120,20 @@ statements: write: 0 arguments: - type: access - relation: '[N] -> { S_4[i] -> in2[i] }' + relation: '[N, M] -> { S_4[i] -> in2[i] }' read: 1 write: 0 - type: call name: f arguments: - type: access - relation: '[N] -> { [S_4[i] -> [i1]] -> A[i + i1, o1] : i1 >= -i and i1 - <= -1 + N - i }' + relation: '[N, M] -> { [S_4[i] -> [i1]] -> A[i + i1, o1] : i1 <= -1 + N + - i and i1 >= -i }' read: 1 write: 0 arguments: - type: access - relation: '[N] -> { S_4[i] -> in2[i] }' + relation: '[N, M] -> { S_4[i] -> in2[i] }' read: 1 write: 0 - type: access @@ -142,6 +143,6 @@ statements: write: 0 arguments: - type: access - relation: '[N] -> { S_4[i] -> in2[i] }' + relation: '[N, M] -> { S_4[i] -> in2[i] }' read: 1 write: 0 diff --git a/tests/conditional_assignment2.scop b/tests/conditional_assignment2.scop index 40a7b92..f2f1e9e 100644 --- a/tests/conditional_assignment2.scop +++ b/tests/conditional_assignment2.scop @@ -1,4 +1,5 @@ -context: '[N, M] -> { : N >= 0 and M >= 0 }' +context: '[N, M] -> { : N >= 0 and M >= 0 and N <= 2147483647 and M <= 2147483647 + }' arrays: - context: '[M, N] -> { : N >= 0 and M >= 0 }' extent: '[N, M] -> { in1[i0, i1] : i0 >= 0 and i1 >= 0 and i0 <= -1 + N and i1 <= @@ -19,42 +20,42 @@ arrays: element_type: int statements: - line: 21 - domain: '{ S_0[] }' + domain: '[N, M] -> { S_0[] }' schedule: '{ S_0[] -> [0] }' body: type: binary operation: = arguments: - type: access - relation: '{ S_0[] -> in2[] }' + relation: '[N, M] -> { S_0[] -> in2[] }' read: 0 write: 1 - type: call name: g2 - line: 23 - domain: '[N] -> { S_1[i] : i >= 0 and i <= -1 + N }' + domain: '[N, M] -> { S_1[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_1[i] -> [1, i, 0] }' body: type: binary operation: = arguments: - type: access - relation: '[N] -> { S_1[i] -> m[] }' + relation: '[N, M] -> { S_1[i] -> m[] }' read: 0 write: 1 - type: binary operation: + arguments: - type: access - relation: '[N] -> { S_1[i] -> [i] }' + relation: '[N, M] -> { S_1[i] -> [i] }' read: 1 write: 0 - type: access - relation: '[N] -> { S_1[i] -> [1] }' + relation: '[N, M] -> { S_1[i] -> [1] }' read: 1 write: 0 - line: 25 - domain: '[M, N] -> { S_2[i, j] : i >= 0 and i <= -1 + N and j >= 0 and j <= -1 + + domain: '[N, M] -> { S_2[i, j] : j >= 0 and i >= 0 and i <= -1 + N and j <= -1 + M }' schedule: '[M, N] -> { S_2[i, j] -> [1, i, 1, j] }' body: @@ -62,7 +63,7 @@ statements: operation: = arguments: - type: access - relation: '[M, N] -> { S_2[i, j] -> m[] }' + relation: '[N, M] -> { S_2[i, j] -> m[] }' read: 0 write: 1 - type: call @@ -72,15 +73,15 @@ statements: name: h arguments: - type: access - relation: '[M, N] -> { S_2[i, j] -> m[] }' + relation: '[N, M] -> { S_2[i, j] -> m[] }' read: 1 write: 0 - type: access - relation: '[M, N] -> { S_2[i, j] -> in1[i, j] }' + relation: '[N, M] -> { S_2[i, j] -> in1[i, j] }' read: 1 write: 0 - line: 26 - domain: '[N] -> { S_3[i] : i >= 0 and i <= -1 + N }' + domain: '[N, M] -> { S_3[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_3[i] -> [1, i, 2] }' body: type: call @@ -90,37 +91,37 @@ statements: name: h arguments: - type: access - relation: '[N] -> { S_3[i] -> m[] }' + relation: '[N, M] -> { S_3[i] -> m[] }' read: 1 write: 0 - type: access - relation: '[N] -> { S_3[i] -> A[i, o1] }' + relation: '[N, M] -> { S_3[i] -> A[i, o1] }' read: 0 write: 1 - line: 28 - domain: '{ S_4[] }' + domain: '[N, M] -> { S_4[] }' schedule: '{ S_4[] -> [2] }' body: type: binary operation: = arguments: - type: access - relation: '{ S_4[] -> A[5, 6] }' + relation: '[N, M] -> { S_4[] -> A[5, 6] }' read: 0 write: 1 - type: access - relation: '{ S_4[] -> [0] }' + relation: '[N, M] -> { S_4[] -> [0] }' read: 1 write: 0 - line: 30 - domain: '[N] -> { S_5[i] : i >= 0 and i <= -1 + N }' + domain: '[N, M] -> { S_5[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_5[i] -> [3, i] }' body: type: binary operation: = arguments: - type: access - relation: '[N] -> { S_5[i] -> C[i] }' + relation: '[N, M] -> { S_5[i] -> C[i] }' read: 0 write: 1 - type: ternary @@ -132,20 +133,20 @@ statements: write: 0 arguments: - type: access - relation: '[N] -> { S_5[i] -> in2[] }' + relation: '[N, M] -> { S_5[i] -> in2[] }' read: 1 write: 0 - type: call name: f arguments: - type: access - relation: '[N] -> { [S_5[i] -> [i1]] -> A[i + i1, o1] : i1 >= -i and i1 - <= -1 + N - i }' + relation: '[N, M] -> { [S_5[i] -> [i1]] -> A[i + i1, o1] : i1 <= -1 + N + - i and i1 >= -i }' read: 1 write: 0 arguments: - type: access - relation: '[N] -> { S_5[i] -> in2[] }' + relation: '[N, M] -> { S_5[i] -> in2[] }' read: 1 write: 0 - type: access @@ -155,6 +156,6 @@ statements: write: 0 arguments: - type: access - relation: '[N] -> { S_5[i] -> in2[] }' + relation: '[N, M] -> { S_5[i] -> in2[] }' read: 1 write: 0 diff --git a/tests/dec.scop b/tests/dec.scop index 1080e59..e7d87b1 100644 --- a/tests/dec.scop +++ b/tests/dec.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i] : i <= -1 + N and i >= 0 }' + domain: '[N] -> { S_0[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_0[i] -> [0, -i] }' body: type: binary diff --git a/tests/dec2.scop b/tests/dec2.scop index 1080e59..e7d87b1 100644 --- a/tests/dec2.scop +++ b/tests/dec2.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i] : i <= -1 + N and i >= 0 }' + domain: '[N] -> { S_0[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_0[i] -> [0, -i] }' body: type: binary diff --git a/tests/dec3.scop b/tests/dec3.scop index 1080e59..e7d87b1 100644 --- a/tests/dec3.scop +++ b/tests/dec3.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i] : i <= -1 + N and i >= 0 }' + domain: '[N] -> { S_0[i] : i >= 0 and i <= -1 + N }' schedule: '[N] -> { S_0[i] -> [0, -i] }' body: type: binary diff --git a/tests/dec4.scop b/tests/dec4.scop index e289367..6281c6d 100644 --- a/tests/dec4.scop +++ b/tests/dec4.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' @@ -6,7 +6,7 @@ arrays: statements: - line: 8 domain: '[N] -> { S_0[i] : exists (e0 = [(-2 - N + i)/3]: 3e0 = -2 - N + i and i - <= -1 + N and i >= 0) }' + >= 0 and i <= -1 + N) }' schedule: '[N] -> { S_0[i] -> [0, -i] }' body: type: binary diff --git a/tests/empty_domain.scop b/tests/empty_domain.scop index 78ba6d0..7ccb4a1 100644 --- a/tests/empty_domain.scop +++ b/tests/empty_domain.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/floord.scop b/tests/floord.scop index 177d6ac..57ce6fd 100644 --- a/tests/floord.scop +++ b/tests/floord.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/floord2.scop b/tests/floord2.scop index 698a288..efbbfbb 100644 --- a/tests/floord2.scop +++ b/tests/floord2.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/implicit_condition.scop b/tests/implicit_condition.scop index a3f530b..7843452 100644 --- a/tests/implicit_condition.scop +++ b/tests/implicit_condition.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/inc.scop b/tests/inc.scop index 2ab674c..e38dc68 100644 --- a/tests/inc.scop +++ b/tests/inc.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/inc2.scop b/tests/inc2.scop index 8c9c1dd..d0d40c5 100644 --- a/tests/inc2.scop +++ b/tests/inc2.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/inc3.scop b/tests/inc3.scop index 2ab674c..e38dc68 100644 --- a/tests/inc3.scop +++ b/tests/inc3.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/iterator_declaration.scop b/tests/iterator_declaration.scop index 2ab674c..e38dc68 100644 --- a/tests/iterator_declaration.scop +++ b/tests/iterator_declaration.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/matmul.scop b/tests/matmul.scop index 47052fc..89daf7e 100644 --- a/tests/matmul.scop +++ b/tests/matmul.scop @@ -1,4 +1,5 @@ -context: '[N, K] -> { : K >= 0 and N >= 0 }' +context: '[N, K] -> { : K >= 0 and N >= 0 and N <= 2147483647 and K <= 2147483647 + }' arrays: - context: '[K] -> { : K >= 0 }' extent: '[K] -> { A[i0, i1] : i0 >= 0 and i1 >= 0 and i1 <= -1 + K }' @@ -12,41 +13,41 @@ arrays: live_out: 1 statements: - line: 9 - domain: '[N, M] -> { S_0[i, j] : i >= 0 and i <= -1 + M and j >= 0 and j <= -1 + - N }' + domain: '[N, K, M] -> { S_0[i, j] : j >= 0 and j <= -1 + N and i >= 0 and i <= -1 + + M }' schedule: '[N, M] -> { S_0[i, j] -> [0, i, j, 0] }' body: type: binary operation: = arguments: - type: access - relation: '[N, M] -> { S_0[i, j] -> C[i, j] }' + relation: '[N, K, M] -> { S_0[i, j] -> C[i, j] }' read: 0 write: 1 - type: access - relation: '[N, M] -> { S_0[i, j] -> [0] }' + relation: '[N, K, M] -> { S_0[i, j] -> [0] }' read: 1 write: 0 - line: 11 - domain: '[K, N, M] -> { S_1[i, j, k] : i >= 0 and i <= -1 + M and j >= 0 and j <= - -1 + N and k >= 0 and k <= -1 + K }' + domain: '[N, K, M] -> { S_1[i, j, k] : j <= -1 + N and k <= -1 + K and i >= 0 and + i <= -1 + M and k >= 0 and j >= 0 }' schedule: '[K, N, M] -> { S_1[i, j, k] -> [0, i, j, 1, k] }' body: type: binary operation: += arguments: - type: access - relation: '[K, N, M] -> { S_1[i, j, k] -> C[i, j] }' + relation: '[N, K, M] -> { S_1[i, j, k] -> C[i, j] }' read: 1 write: 1 - type: binary operation: '*' arguments: - type: access - relation: '[K, N, M] -> { S_1[i, j, k] -> A[i, k] }' + relation: '[N, K, M] -> { S_1[i, j, k] -> A[i, k] }' read: 1 write: 0 - type: access - relation: '[K, N, M] -> { S_1[i, j, k] -> B[k, j] }' + relation: '[N, K, M] -> { S_1[i, j, k] -> B[k, j] }' read: 1 write: 0 diff --git a/tests/max.scop b/tests/max.scop index 7763f24..70b271c 100644 --- a/tests/max.scop +++ b/tests/max.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i] : i >= 0 and i >= -10 + N and i <= -1 + N }' + domain: '[N] -> { S_0[i] : i <= -1 + N and i >= -10 + N and i >= 0 }' schedule: '[N] -> { S_0[i] -> [0, i] }' body: type: binary diff --git a/tests/min.scop b/tests/min.scop index 6c49868..637f29a 100644 --- a/tests/min.scop +++ b/tests/min.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i] : i <= -1 + N and i <= -11 + 2N and i >= 0 }' + domain: '[N] -> { S_0[i] : i <= -11 + 2N and i <= -1 + N and i >= 0 }' schedule: '[N] -> { S_0[i] -> [0, i] }' body: type: binary diff --git a/tests/min2.scop b/tests/min2.scop index 136d40c..a84840b 100644 --- a/tests/min2.scop +++ b/tests/min2.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' element_type: int statements: - line: 10 - domain: '[N] -> { S_0[i] : i <= -1 + N and i <= -11 + 2N and i >= 0 }' + domain: '[N] -> { S_0[i] : i <= -11 + 2N and i <= -1 + N and i >= 0 }' schedule: '[N] -> { S_0[i] -> [0, i] }' body: type: binary diff --git a/tests/mod.scop b/tests/mod.scop index 84cc78c..65e6f1e 100644 --- a/tests/mod.scop +++ b/tests/mod.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0] : i0 >= 0 and i0 <= -1 + N }' diff --git a/tests/piecewise.scop b/tests/piecewise.scop index 4fb7a19..54462bf 100644 --- a/tests/piecewise.scop +++ b/tests/piecewise.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0, i1] : i0 >= 0 and i1 >= 0 and i1 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i, j] : j >= i and j <= -1 + N and i >= 0 }' + domain: '[N] -> { S_0[i, j] : i >= 0 and j >= i and j <= -1 + N }' schedule: '[N] -> { S_0[i, j] -> [0, i, j] }' body: type: binary diff --git a/tests/piecewise2.scop b/tests/piecewise2.scop index 4fb7a19..54462bf 100644 --- a/tests/piecewise2.scop +++ b/tests/piecewise2.scop @@ -1,11 +1,11 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0, i1] : i0 >= 0 and i1 >= 0 and i1 <= -1 + N }' element_type: int statements: - line: 8 - domain: '[N] -> { S_0[i, j] : j >= i and j <= -1 + N and i >= 0 }' + domain: '[N] -> { S_0[i, j] : i >= 0 and j >= i and j <= -1 + N }' schedule: '[N] -> { S_0[i, j] -> [0, i, j] }' body: type: binary diff --git a/tests/propagate.scop b/tests/propagate.scop index 9199b6b..3e0e82f 100644 --- a/tests/propagate.scop +++ b/tests/propagate.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '[N] -> { : N >= 0 }' extent: '[N] -> { a[i0, i1] : i0 >= 0 and i1 >= 0 and i1 <= -1 + N }' @@ -8,7 +8,7 @@ arrays: element_type: int statements: - line: 9 - domain: '[N] -> { S_0[i, j] : j >= i and j <= -1 + N and i >= 0 }' + domain: '[N] -> { S_0[i, j] : i >= 0 and j >= i and j <= -1 + N }' schedule: '[N] -> { S_0[i, j] -> [0, i, j, 0] }' body: type: binary @@ -47,7 +47,7 @@ statements: read: 1 write: 0 - line: 10 - domain: '[N] -> { S_1[i, j] : j >= i and j <= -1 + N and i >= 0 }' + domain: '[N] -> { S_1[i, j] : i >= 0 and j >= i and j <= -1 + N }' schedule: '[N] -> { S_1[i, j] -> [0, i, j, 1] }' body: type: binary diff --git a/tests/quasi_affine.scop b/tests/quasi_affine.scop index 93a7c7f..d283897 100644 --- a/tests/quasi_affine.scop +++ b/tests/quasi_affine.scop @@ -1,4 +1,4 @@ -context: '[N] -> { : N >= 0 }' +context: '[N] -> { : N >= 0 and N <= 2147483647 }' arrays: - context: '{ : }' extent: '{ in[] }' @@ -26,7 +26,7 @@ statements: read: 1 write: 0 - line: 16 - domain: '[N] -> { S_1[i] : i <= N and i >= 1 }' + domain: '[N] -> { S_1[i] : i >= 1 and i <= N }' schedule: '[N] -> { S_1[i] -> [0, 1, i, 0] }' body: type: binary @@ -43,7 +43,7 @@ statements: name: g arguments: - type: access - relation: '[N] -> { S_1[i] -> A[o0] : 2o0 >= -1 + i and 2o0 <= i }' + relation: '[N] -> { S_1[i] -> A[o0] : 2o0 <= i and 2o0 >= -1 + i }' read: 1 write: 0 - line: 18 -- 2.11.4.GIT