From 4f12fdbe163ba7a562641ce9219413c6de200022 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 24 Mar 2014 17:06:53 +0100 Subject: [PATCH] pet_scop_collect_arrays: collect arrays in a sorted set This ensure that the order in which arrays are added to scops is the same on all platforms. Signed-off-by: Sven Verdoolaege --- scan.cc | 4 +- scop_plus.cc | 10 ++-- scop_plus.h | 27 ++++++++++- tests/arg.scop | 4 +- tests/conditional_assignment.scop | 18 ++++---- tests/conditional_assignment2.scop | 94 +++++++++++++++++++------------------- tests/continue2.scop | 4 +- tests/continue3.scop | 4 +- tests/continue4.scop | 4 +- tests/continue5.scop | 4 +- tests/data_dependent.scop | 18 ++++---- tests/data_dependent2.scop | 4 +- tests/dynamic_bound.scop | 4 +- tests/dynamic_condition.scop | 4 +- tests/filter.scop | 4 +- tests/filter2.scop | 4 +- tests/filter3.scop | 4 +- tests/quasi_affine.scop | 8 ++-- tests/struct7.scop | 8 ++-- tests/struct8.scop | 8 ++-- tests/ternary.scop | 4 +- tests/wdp.scop | 8 ++-- 22 files changed, 137 insertions(+), 114 deletions(-) diff --git a/scan.cc b/scan.cc index f0d63b1..dfe2d1a 100644 --- a/scan.cc +++ b/scan.cc @@ -5353,8 +5353,8 @@ static struct pet_scop *add_type(isl_ctx *ctx, struct pet_scop *scop, struct pet_scop *PetScan::scan_arrays(struct pet_scop *scop) { int i; - set > arrays; - set >::iterator it; + array_desc_set arrays; + array_desc_set::iterator it; lex_recorddecl_set types; lex_recorddecl_set types_done; lex_recorddecl_set::iterator types_it; diff --git a/scop_plus.cc b/scop_plus.cc index d8bcb68..a67f8ae 100644 --- a/scop_plus.cc +++ b/scop_plus.cc @@ -51,7 +51,7 @@ using namespace clang; * structure. */ static void collect_sub_arrays(ValueDecl *decl, vector ancestors, - set > &arrays) + array_desc_set &arrays) { QualType type = decl->getType(); RecordDecl *record; @@ -94,7 +94,7 @@ static void collect_sub_arrays(ValueDecl *decl, vector ancestors, * to the scalar. */ static void access_collect_arrays(__isl_keep pet_expr *expr, - set > &arrays) + array_desc_set &arrays) { isl_id *id; isl_space *space; @@ -125,7 +125,7 @@ static void access_collect_arrays(__isl_keep pet_expr *expr, } static void expr_collect_arrays(__isl_keep pet_expr *expr, - set > &arrays) + array_desc_set &arrays) { int n; @@ -146,7 +146,7 @@ static void expr_collect_arrays(__isl_keep pet_expr *expr, } static void stmt_collect_arrays(struct pet_stmt *stmt, - set > &arrays) + array_desc_set &arrays) { if (!stmt) return; @@ -169,7 +169,7 @@ static void stmt_collect_arrays(struct pet_stmt *stmt, * to be simple arrays, represented by a sequence of a single element. */ void pet_scop_collect_arrays(struct pet_scop *scop, - set > &arrays) + array_desc_set &arrays) { if (!scop) return; diff --git a/scop_plus.h b/scop_plus.h index aaee707..71a72a8 100644 --- a/scop_plus.h +++ b/scop_plus.h @@ -7,7 +7,30 @@ #include "scop.h" -void pet_scop_collect_arrays(struct pet_scop *scop, - std::set > &arrays); +/* Compare two sequences of ValueDecl pointers based on their names. + */ +struct array_desc_less { + bool operator()(const std::vector &x, + const std::vector &y) { + int x_n = x.size(); + int y_n = y.size(); + + for (int i = 0; i < x_n && i < y_n; ++i) { + int cmp = x[i]->getName().compare(y[i]->getName()); + if (cmp) + return cmp < 0; + } + + return x_n < y_n; + } +}; + +/* A sorted set of sequences of ValueDecl pointers. The actual order + * is not important, only that it is consistent across platforms. + */ +typedef std::set, array_desc_less> + array_desc_set; + +void pet_scop_collect_arrays(struct pet_scop *scop, array_desc_set &arrays); #endif diff --git a/tests/arg.scop b/tests/arg.scop index 17f8f69..be1f26c 100644 --- a/tests/arg.scop +++ b/tests/arg.scop @@ -3,11 +3,11 @@ end: 166 context: '{ : }' arrays: - context: '{ : }' - extent: '{ b[i0] : i0 >= 0 and i0 <= 10 }' + extent: '{ a[] }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[] }' + extent: '{ b[i0] : i0 >= 0 and i0 <= 10 }' element_type: int element_size: 4 statements: diff --git a/tests/conditional_assignment.scop b/tests/conditional_assignment.scop index 118b17c..1983992 100644 --- a/tests/conditional_assignment.scop +++ b/tests/conditional_assignment.scop @@ -3,23 +3,23 @@ end: 496 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] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and - i0 >= 0 }' +- context: '[N] -> { : N >= 0 }' + extent: '[N, M] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= + 9 }' element_type: int element_size: 4 - context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { in2[i0] : i0 <= -1 + N and i0 >= 0 }' - value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }' + extent: '[N, M] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }' element_type: int element_size: 4 -- context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= - 9 }' +- context: '[M, N] -> { : N >= 0 and M >= 0 }' + extent: '[N, M] -> { in1[i0, i1] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and + i0 >= 0 }' element_type: int element_size: 4 - context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }' + extent: '[N, M] -> { in2[i0] : i0 <= -1 + N and i0 >= 0 }' + value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }' element_type: int element_size: 4 - context: '{ : }' diff --git a/tests/conditional_assignment2.scop b/tests/conditional_assignment2.scop index 8b4bdff..a38b7aa 100644 --- a/tests/conditional_assignment2.scop +++ b/tests/conditional_assignment2.scop @@ -1,57 +1,57 @@ start: 225 end: 507 -context: '[N, M] -> { : N >= 0 and M >= 0 and N <= 2147483647 and M <= 2147483647 +context: '[M, N] -> { : N >= 0 and M >= 0 and M <= 2147483647 and N <= 2147483647 }' arrays: -- context: '[M, N] -> { : N >= 0 and M >= 0 }' - extent: '[N, M] -> { in1[i0, i1] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and - i0 >= 0 }' +- context: '[N] -> { : N >= 0 }' + extent: '[M, N] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= + 9 }' element_type: int element_size: 4 -- context: '{ : }' - extent: '[N, M] -> { in2[] }' - value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }' +- context: '[N] -> { : N >= 0 }' + extent: '[M, N] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }' element_type: int element_size: 4 -- context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= - 9 }' +- context: '[M, N] -> { : N >= 0 and M >= 0 }' + extent: '[M, N] -> { in1[i0, i1] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and + i0 >= 0 }' element_type: int element_size: 4 -- context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }' +- context: '{ : }' + extent: '[M, N] -> { in2[] }' + value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }' element_type: int element_size: 4 - context: '{ : }' - extent: '[N, M] -> { m[] }' + extent: '[M, N] -> { m[] }' element_type: int element_size: 4 statements: - line: 21 - domain: '[N, M] -> { S_0[] }' + domain: '[M, N] -> { S_0[] }' schedule: '{ S_0[] -> [0] }' body: type: op operation: = arguments: - type: access - relation: '[N, M] -> { S_0[] -> in2[] }' - index: '[N, M] -> { S_0[] -> in2[] }' + relation: '[M, N] -> { S_0[] -> in2[] }' + index: '[M, N] -> { S_0[] -> in2[] }' reference: __pet_ref_0 read: 0 write: 1 - type: call name: g2 - line: 23 - domain: '[N, M] -> { S_1[i] : i <= -1 + N and i >= 0 }' + domain: '[M, N] -> { S_1[i] : i <= -1 + N and i >= 0 }' schedule: '[N] -> { S_1[i] -> [1, i, 0] }' body: type: op operation: = arguments: - type: access - relation: '[N, M] -> { S_1[i] -> m[] }' - index: '[N, M] -> { S_1[i] -> m[] }' + relation: '[M, N] -> { S_1[i] -> m[] }' + index: '[M, N] -> { S_1[i] -> m[] }' reference: __pet_ref_1 read: 0 write: 1 @@ -59,15 +59,15 @@ statements: operation: + arguments: - type: access - relation: '[N, M] -> { S_1[i] -> [i] }' - index: '[N, M] -> { S_1[i] -> [(i)] }' + relation: '[M, N] -> { S_1[i] -> [i] }' + index: '[M, N] -> { S_1[i] -> [(i)] }' reference: __pet_ref_2 read: 1 write: 0 - type: int value: 1 - line: 25 - domain: '[N, M] -> { S_2[i, j] : j <= -1 + M and j >= 0 and i <= -1 + N and i >= + domain: '[M, N] -> { S_2[i, j] : j <= -1 + M and j >= 0 and i <= -1 + N and i >= 0 }' schedule: '[M, N] -> { S_2[i, j] -> [1, i, 1, j] }' body: @@ -75,8 +75,8 @@ statements: operation: = arguments: - type: access - relation: '[N, M] -> { S_2[i, j] -> m[] }' - index: '[N, M] -> { S_2[i, j] -> m[] }' + relation: '[M, N] -> { S_2[i, j] -> m[] }' + index: '[M, N] -> { S_2[i, j] -> m[] }' reference: __pet_ref_3 read: 0 write: 1 @@ -87,19 +87,19 @@ statements: name: h arguments: - type: access - relation: '[N, M] -> { S_2[i, j] -> m[] }' - index: '[N, M] -> { S_2[i, j] -> m[] }' + relation: '[M, N] -> { S_2[i, j] -> m[] }' + index: '[M, N] -> { S_2[i, j] -> m[] }' reference: __pet_ref_4 read: 1 write: 0 - type: access - relation: '[N, M] -> { S_2[i, j] -> in1[i, j] }' - index: '[N, M] -> { S_2[i, j] -> in1[(i), (j)] }' + relation: '[M, N] -> { S_2[i, j] -> in1[i, j] }' + index: '[M, N] -> { S_2[i, j] -> in1[(i), (j)] }' reference: __pet_ref_5 read: 1 write: 0 - line: 26 - domain: '[N, M] -> { S_3[i] : i <= -1 + N and i >= 0 }' + domain: '[M, N] -> { S_3[i] : i <= -1 + N and i >= 0 }' schedule: '[N] -> { S_3[i] -> [1, i, 2] }' body: type: call @@ -109,42 +109,42 @@ statements: name: h arguments: - type: access - relation: '[N, M] -> { S_3[i] -> m[] }' - index: '[N, M] -> { S_3[i] -> m[] }' + relation: '[M, N] -> { S_3[i] -> m[] }' + index: '[M, N] -> { S_3[i] -> m[] }' reference: __pet_ref_6 read: 1 write: 0 - type: access - relation: '[N, M] -> { S_3[i] -> A[i, o1] }' - index: '[N, M] -> { S_3[i] -> A[(i)] }' + relation: '[M, N] -> { S_3[i] -> A[i, o1] }' + index: '[M, N] -> { S_3[i] -> A[(i)] }' reference: __pet_ref_7 read: 0 write: 1 - line: 28 - domain: '[N, M] -> { S_4[] }' + domain: '[M, N] -> { S_4[] }' schedule: '{ S_4[] -> [2] }' body: type: op operation: = arguments: - type: access - relation: '[N, M] -> { S_4[] -> A[5, 6] }' - index: '[N, M] -> { S_4[] -> A[(5), (6)] }' + relation: '[M, N] -> { S_4[] -> A[5, 6] }' + index: '[M, N] -> { S_4[] -> A[(5), (6)] }' reference: __pet_ref_8 read: 0 write: 1 - type: int value: 0 - line: 30 - domain: '[N, M] -> { S_5[i] : i <= -1 + N and i >= 0 }' + domain: '[M, N] -> { S_5[i] : i <= -1 + N and i >= 0 }' schedule: '[N] -> { S_5[i] -> [3, i] }' body: type: op operation: = arguments: - type: access - relation: '[N, M] -> { S_5[i] -> C[i] }' - index: '[N, M] -> { S_5[i] -> C[(i)] }' + relation: '[M, N] -> { S_5[i] -> C[i] }' + index: '[M, N] -> { S_5[i] -> C[(i)] }' reference: __pet_ref_9 read: 0 write: 1 @@ -152,17 +152,17 @@ statements: operation: '?:' arguments: - type: access - relation: '[N, M] -> { [S_5[i] -> [i1]] -> [1] : i1 >= -i and i1 <= -1 + N + relation: '[M, N] -> { [S_5[i] -> [i1]] -> [1] : i1 >= -i and i1 <= -1 + N - i; [S_5[-1 + N] -> [1]] -> [0]; [S_5[0] -> [-1]] -> [0] }' - index: '[N, M] -> { [S_5[i] -> [i1]] -> [((1) : i1 >= -i and i1 <= -1 + N + index: '[M, N] -> { [S_5[i] -> [i1]] -> [((1) : i1 >= -i and i1 <= -1 + N - i; (0) : i = -1 + N and i1 = 1; (0) : i = 0 and i1 = -1)] }' reference: __pet_ref_11 read: 1 write: 0 arguments: - type: access - relation: '[N, M] -> { S_5[i] -> in2[] }' - index: '[N, M] -> { S_5[i] -> in2[] }' + relation: '[M, N] -> { S_5[i] -> in2[] }' + index: '[M, N] -> { S_5[i] -> in2[] }' reference: __pet_ref_10 read: 1 write: 0 @@ -170,16 +170,16 @@ statements: name: f arguments: - type: access - relation: '[N, M] -> { [S_5[i] -> [i1]] -> A[i + i1, o1] : i1 >= -i and + relation: '[M, N] -> { [S_5[i] -> [i1]] -> A[i + i1, o1] : i1 >= -i and i1 <= -1 + N - i }' - index: '[N, M] -> { [S_5[i] -> [i1]] -> A[((i + i1) : i1 >= -i)] }' + index: '[M, N] -> { [S_5[i] -> [i1]] -> A[((i + i1) : i1 >= -i)] }' reference: __pet_ref_13 read: 1 write: 0 arguments: - type: access - relation: '[N, M] -> { S_5[i] -> in2[] }' - index: '[N, M] -> { S_5[i] -> in2[] }' + relation: '[M, N] -> { S_5[i] -> in2[] }' + index: '[M, N] -> { S_5[i] -> in2[] }' reference: __pet_ref_12 read: 1 write: 0 diff --git a/tests/continue2.scop b/tests/continue2.scop index 5e422e9..2c9b009 100644 --- a/tests/continue2.scop +++ b/tests/continue2.scop @@ -27,11 +27,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ j[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' + extent: '{ j[] }' element_type: int element_size: 4 statements: diff --git a/tests/continue3.scop b/tests/continue3.scop index 66ba9f3..5440d23 100644 --- a/tests/continue3.scop +++ b/tests/continue3.scop @@ -21,11 +21,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ j[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' + extent: '{ j[] }' element_type: int element_size: 4 statements: diff --git a/tests/continue4.scop b/tests/continue4.scop index 1d2fe12..b2945fd 100644 --- a/tests/continue4.scop +++ b/tests/continue4.scop @@ -15,11 +15,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ j[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' + extent: '{ j[] }' element_type: int element_size: 4 statements: diff --git a/tests/continue5.scop b/tests/continue5.scop index 73ba050..9e94ed0 100644 --- a/tests/continue5.scop +++ b/tests/continue5.scop @@ -15,11 +15,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ j[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' + extent: '{ j[] }' element_type: int element_size: 4 statements: diff --git a/tests/data_dependent.scop b/tests/data_dependent.scop index 71b3bcc..74cf19e 100644 --- a/tests/data_dependent.scop +++ b/tests/data_dependent.scop @@ -2,23 +2,23 @@ start: 274 end: 498 context: '[N, M] -> { : N >= 10 and N <= 1000 and M >= 10 and M <= 1000 }' arrays: -- context: '[M, N] -> { : N >= 0 and M >= 0 }' - extent: '[N, M] -> { in1[i0, i1] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and - i0 >= 0 }' +- context: '[N] -> { : N >= 0 }' + extent: '[N, M] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= + 9 }' element_type: int element_size: 4 - context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { in2[i0] : i0 <= -1 + N and i0 >= 0 }' - value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }' + extent: '[N, M] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }' element_type: int element_size: 4 -- context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= - 9 }' +- context: '[M, N] -> { : N >= 0 and M >= 0 }' + extent: '[N, M] -> { in1[i0, i1] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and + i0 >= 0 }' element_type: int element_size: 4 - context: '[N] -> { : N >= 0 }' - extent: '[N, M] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }' + extent: '[N, M] -> { in2[i0] : i0 <= -1 + N and i0 >= 0 }' + value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }' element_type: int element_size: 4 - context: '{ : }' diff --git a/tests/data_dependent2.scop b/tests/data_dependent2.scop index 72a2e3c..c537613 100644 --- a/tests/data_dependent2.scop +++ b/tests/data_dependent2.scop @@ -9,11 +9,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 9 }' + extent: '{ N[] }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ N[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 9 }' element_type: int element_size: 4 statements: diff --git a/tests/dynamic_bound.scop b/tests/dynamic_bound.scop index 25d1f23..55da373 100644 --- a/tests/dynamic_bound.scop +++ b/tests/dynamic_bound.scop @@ -3,12 +3,12 @@ end: 351 context: '{ : }' arrays: - context: '{ : }' - extent: '{ N[] }' + extent: '{ M[] }' value_bounds: '{ [i0] : i0 >= 0 and i0 <= 100 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ M[] }' + extent: '{ N[] }' value_bounds: '{ [i0] : i0 >= 0 and i0 <= 100 }' element_type: int element_size: 4 diff --git a/tests/dynamic_condition.scop b/tests/dynamic_condition.scop index 3d9cdae..c4522a2 100644 --- a/tests/dynamic_condition.scop +++ b/tests/dynamic_condition.scop @@ -3,11 +3,11 @@ end: 174 context: '{ : }' arrays: - context: '{ : }' - extent: '{ j[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' + extent: '{ j[] }' element_type: int element_size: 4 statements: diff --git a/tests/filter.scop b/tests/filter.scop index e1c9c72..53f51c0 100644 --- a/tests/filter.scop +++ b/tests/filter.scop @@ -3,11 +3,11 @@ end: 102 context: '{ : }' arrays: - context: '{ : }' - extent: '{ test[i0] : i0 >= 0 }' + extent: '{ a[] }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[] }' + extent: '{ test[i0] : i0 >= 0 }' element_type: int element_size: 4 statements: diff --git a/tests/filter2.scop b/tests/filter2.scop index 13a6b6d..95606e8 100644 --- a/tests/filter2.scop +++ b/tests/filter2.scop @@ -9,11 +9,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ test[i0] : i0 >= 0 }' + extent: '{ index[] }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ index[] }' + extent: '{ test[i0] : i0 >= 0 }' element_type: int element_size: 4 statements: diff --git a/tests/filter3.scop b/tests/filter3.scop index a375107..a57146c 100644 --- a/tests/filter3.scop +++ b/tests/filter3.scop @@ -9,11 +9,11 @@ arrays: element_size: 4 uniquely_defined: 1 - context: '{ : }' - extent: '{ test[i0] : i0 >= 0 }' + extent: '{ index[] }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ index[] }' + extent: '{ test[i0] : i0 >= 0 }' element_type: int element_size: 4 statements: diff --git a/tests/quasi_affine.scop b/tests/quasi_affine.scop index c5270a9..1f2034f 100644 --- a/tests/quasi_affine.scop +++ b/tests/quasi_affine.scop @@ -2,15 +2,15 @@ start: 84 end: 218 context: '[N] -> { : N <= 2147483647 and N >= 0 }' arrays: -- context: '{ : }' - extent: '[N] -> { in[] }' - element_type: int - element_size: 4 - context: '[N] -> { : N >= 0 }' extent: '[N] -> { A[i0] : i0 <= -1 + N and i0 >= 0 }' element_type: int element_size: 4 - context: '{ : }' + extent: '[N] -> { in[] }' + element_type: int + element_size: 4 +- context: '{ : }' extent: '[N] -> { out[] }' element_type: int element_size: 4 diff --git a/tests/struct7.scop b/tests/struct7.scop index d47f255..ef9d73d 100644 --- a/tests/struct7.scop +++ b/tests/struct7.scop @@ -18,11 +18,11 @@ arrays: element_size: 8 element_is_record: 1 - context: '{ : }' - extent: '{ p_a_re[p_a[p[] -> a[]] -> re[]] }' + extent: '{ p_a_im[p_a[p[] -> a[]] -> im[]] }' element_type: float element_size: 4 - context: '{ : }' - extent: '{ p_a_im[p_a[p[] -> a[]] -> im[]] }' + extent: '{ p_a_re[p_a[p[] -> a[]] -> re[]] }' element_type: float element_size: 4 - context: '{ : }' @@ -31,11 +31,11 @@ arrays: element_size: 8 element_is_record: 1 - context: '{ : }' - extent: '{ p_b_re[p_b[p[] -> b[]] -> re[]] }' + extent: '{ p_b_im[p_b[p[] -> b[]] -> im[]] }' element_type: float element_size: 4 - context: '{ : }' - extent: '{ p_b_im[p_b[p[] -> b[]] -> im[]] }' + extent: '{ p_b_re[p_b[p[] -> b[]] -> re[]] }' element_type: float element_size: 4 statements: diff --git a/tests/struct8.scop b/tests/struct8.scop index 3c0ef0f..e4dc3bd 100644 --- a/tests/struct8.scop +++ b/tests/struct8.scop @@ -12,6 +12,10 @@ arrays: element_size: 404 element_is_record: 1 - context: '{ : }' + extent: '{ s_b[s[] -> b[]] }' + element_type: int + element_size: 4 +- context: '{ : }' extent: '{ s_f[s[] -> f[i0]] : i0 >= 0 and i0 <= 9 }' element_type: element_size: 40 @@ -21,10 +25,6 @@ arrays: i1 <= 9 }' element_type: int element_size: 4 -- context: '{ : }' - extent: '{ s_b[s[] -> b[]] }' - element_type: int - element_size: 4 statements: - line: 17 domain: '{ S_0[i, j] : i >= 0 and i <= 9 and j >= 0 and j <= 9 }' diff --git a/tests/ternary.scop b/tests/ternary.scop index e5d1cda..5e605d1 100644 --- a/tests/ternary.scop +++ b/tests/ternary.scop @@ -3,11 +3,11 @@ end: 141 context: '{ : }' arrays: - context: '{ : }' - extent: '{ j[] }' + extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' element_type: int element_size: 4 - context: '{ : }' - extent: '{ a[i0] : i0 >= 0 and i0 <= 99 }' + extent: '{ j[] }' element_type: int element_size: 4 statements: diff --git a/tests/wdp.scop b/tests/wdp.scop index 4d2040e..ec96a47 100644 --- a/tests/wdp.scop +++ b/tests/wdp.scop @@ -8,6 +8,10 @@ arrays: element_type: int element_size: 4 uniquely_defined: 1 +- context: '[N] -> { : N >= -1 and N <= 2147483646 }' + extent: '[N] -> { t[i0] : i0 <= N and i0 >= 0 }' + element_type: int + element_size: 4 - context: '[N] -> { : N >= 0 }' extent: '[N] -> { x[i0] : i0 <= -1 + N and i0 >= 0 }' element_type: int @@ -16,10 +20,6 @@ arrays: extent: '[N] -> { y[i0] : i0 <= N and i0 >= 0 }' element_type: int element_size: 4 -- context: '[N] -> { : N >= -1 and N <= 2147483646 }' - extent: '[N] -> { t[i0] : i0 <= N and i0 >= 0 }' - element_type: int - element_size: 4 - context: '[N] -> { : N >= -2 and N <= 2147483645 }' extent: '[N] -> { z[i0] : i0 <= 1 + N and i0 >= 0 }' element_type: int -- 2.11.4.GIT