[llvm-commits] [polly] r144639 - in /polly/trunk: include/polly/ScopInfo.h lib/Analysis/ScopInfo.cpp lib/Exchange/JSONExporter.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Tue Nov 15 03:38:44 PST 2011
Author: grosser
Date: Tue Nov 15 05:38:44 2011
New Revision: 144639
URL: http://llvm.org/viewvc/llvm-project?rev=144639&view=rev
Log:
JScop: Allow to update the context
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/lib/Exchange/JSONExporter.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=144639&r1=144638&r2=144639&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Tue Nov 15 05:38:44 2011
@@ -547,6 +547,8 @@
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();
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=144639&r1=144638&r2=144639&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Nov 15 05:38:44 2011
@@ -843,6 +843,12 @@
//===----------------------------------------------------------------------===//
/// 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) {
Modified: polly/trunk/lib/Exchange/JSONExporter.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=144639&r1=144638&r2=144639&view=diff
==============================================================================
--- polly/trunk/lib/Exchange/JSONExporter.cpp (original)
+++ polly/trunk/lib/Exchange/JSONExporter.cpp Tue Nov 15 05:38:44 2011
@@ -228,6 +228,19 @@
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;
More information about the llvm-commits
mailing list