ScopLib: Support negated access functions.
authorTobias Grosser <grosser@fim.uni-passau.de>
Sun, 7 Oct 2012 17:43:23 +0000 (17:43 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Sun, 7 Oct 2012 17:43:23 +0000 (17:43 +0000)
Scoplib only supports access functions, but not the more generic
access relations. This commit now also supports access functions
that where not directly expresses as A[sub] with sub = i + 5b,
but with A[sub] with -sub = -i + (-5b).

Test case to come.

Contributed by: Dustin Feld <d3.feld@gmail.com>

llvm-svn: 165379

polly/lib/Exchange/ScopLib.cpp

index f094c49..72809a2 100644 (file)
@@ -372,8 +372,9 @@ int ScopLib::accessToMatrix_constraint(isl_constraint *c, void *user) {
 
   // The access dimension has to be one.
   isl_constraint_get_coefficient(c, isl_dim_out, 0, &v);
-  assert(isl_int_is_one(v));
-  bool inverse = true ;
+  assert((isl_int_is_one(v) || isl_int_is_negone(v))
+         && "Access relations not supported in scoplib");
+  bool inverse = isl_int_is_one(v);
 
   // Assign variables
   for (int i = 0; i < nb_in; ++i) {