JScoP Import/Export: Ensure parameters have the same isl_id
authorTobias Grosser <tobias@grosser.es>
Thu, 23 Apr 2015 12:23:56 +0000 (12:23 +0000)
committerTobias Grosser <tobias@grosser.es>
Thu, 23 Apr 2015 12:23:56 +0000 (12:23 +0000)
When reading parameters from a JSON file parameters with identical names
may be related to different isl_ids, which then causes isl to treat them
as differnet objects. This does not cause issues at the moment, but has
shown problematic in subsequent schedule tree changes.

This commit will be tested by the following changes.

llvm-svn: 235588

polly/lib/Exchange/JSONExporter.cpp

index 8489e8f..b9dcaad 100644 (file)
@@ -236,6 +236,10 @@ bool JSONImporter::runOnScop(Scop &S) {
     // that stores the reference to the ScopStmt this schedule belongs to.
     m = isl_map_set_tuple_id(m, isl_dim_in,
                              isl_space_get_tuple_id(Space, isl_dim_set));
+    for (unsigned i = 0; i < isl_space_dim(Space, isl_dim_param); i++) {
+      isl_id *id = isl_space_get_dim_id(Space, isl_dim_param, i);
+      m = isl_map_set_dim_id(m, isl_dim_param, i, id);
+    }
     isl_space_free(Space);
     NewSchedule[*SI] = m;
     index++;