diff options
| author | Tobias Grosser <grosser@fim.uni-passau.de> | 2011-11-15 11:38:44 +0000 |
|---|---|---|
| committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2011-11-15 11:38:44 +0000 |
| commit | ff9b54d5a9f311e30e076ec9ba05f3068b96f16a (patch) | |
| tree | e7863c7c3f3219a6845cdc3163d6377790f8111f /polly/lib | |
| parent | ecf6cd06f0d56d3d410d9fff50a58da154e2f212 (diff) | |
| download | bcm5719-llvm-ff9b54d5a9f311e30e076ec9ba05f3068b96f16a.tar.gz bcm5719-llvm-ff9b54d5a9f311e30e076ec9ba05f3068b96f16a.zip | |
JScop: Allow to update the context
llvm-svn: 144639
Diffstat (limited to 'polly/lib')
| -rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 6 | ||||
| -rwxr-xr-x | polly/lib/Exchange/JSONExporter.cpp | 13 |
2 files changed, 19 insertions, 0 deletions
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; |

