diff options
| -rwxr-xr-x | polly/include/polly/ScopInfo.h | 2 | ||||
| -rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 6 | ||||
| -rwxr-xr-x | polly/lib/Exchange/JSONExporter.cpp | 13 |
3 files changed, 21 insertions, 0 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 5f167089108..b05bdb797b1 100755 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -547,6 +547,8 @@ public: const_reverse_iterator rend() const { return Stmts.rend(); } //@} + void setContext(isl_set* NewContext); + /// @brief Align the parameters in the statement to the scop context void realignParams(); diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 7e542eb7e5f..34e7ae35264 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -843,6 +843,12 @@ void ScopStmt::dump() const { print(dbgs()); } //===----------------------------------------------------------------------===// /// Scop class implement +void Scop::setContext(__isl_take isl_set* NewContext) { + NewContext = isl_set_align_params(NewContext, isl_set_get_space(Context)); + isl_set_free(Context); + Context = NewContext; +} + void Scop::addParams(std::vector<const SCEV*> NewParameters) { for (std::vector<const SCEV*>::iterator PI = NewParameters.begin(), PE = NewParameters.end(); PI != PE; ++PI) { diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp index 00c9f88e2e5..b1488c63b0a 100755 --- a/polly/lib/Exchange/JSONExporter.cpp +++ b/polly/lib/Exchange/JSONExporter.cpp @@ -228,6 +228,19 @@ bool JSONImporter::runOnScop(Scop &scop) { return false; } + isl_set *OldContext = S->getContext(); + isl_set *NewContext = isl_set_read_from_str(S->getIslCtx(), + jscop["context"].asCString()); + + for (unsigned i = 0; i < isl_set_dim(OldContext, isl_dim_param); i++) { + isl_id *id = isl_set_get_dim_id(OldContext, isl_dim_param, i); + NewContext = isl_set_set_dim_id(NewContext, isl_dim_param, i, id); + + } + + isl_set_free(OldContext); + S->setContext(NewContext); + StatementToIslMapTy &NewScattering = *(new StatementToIslMapTy()); int index = 0; |

