summaryrefslogtreecommitdiffstats
path: root/polly/lib/Exchange/JSONExporter.cpp
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2011-10-06 00:04:11 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2011-10-06 00:04:11 +0000
commit5d4538129475f9f2456136757a90911474e97895 (patch)
treee60385a7e60351d90c1d959c4f34885e82177e65 /polly/lib/Exchange/JSONExporter.cpp
parentcf3942dfa6162d78e591e6356765d4fd769c4864 (diff)
downloadbcm5719-llvm-5d4538129475f9f2456136757a90911474e97895.tar.gz
bcm5719-llvm-5d4538129475f9f2456136757a90911474e97895.zip
ScopInfo: Only give away a copy of the access relation.
Also take the chance and rename access functions to access relations. This is because we do not only allow plain functions to describe an access, but we can have any access relation that can be described with linear constraints. llvm-svn: 141257
Diffstat (limited to 'polly/lib/Exchange/JSONExporter.cpp')
-rwxr-xr-xpolly/lib/Exchange/JSONExporter.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index aa5d719ad29..3a45cb1a8c7 100755
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -117,7 +117,7 @@ Json::Value JSONExporter::getJSON(Scop &scop) const {
Json::Value access;
access["kind"] = (*MI)->isRead() ? "read" : "write";
- access["relation"] = (*MI)->getAccessFunctionStr();
+ access["relation"] = (*MI)->getAccessRelationStr();
statement["accesses"].append(access);
}
@@ -247,11 +247,11 @@ bool JSONImporter::runOnScop(Scop &scop) {
return false;
}
- for (Scop::iterator SI = S->begin(), SE = S->end(); SI != SE; ++SI) {
- ScopStmt *Stmt = *SI;
+ for (Scop::iterator SI = S->begin(), SE = S->end(); SI != SE; ++SI) {
+ ScopStmt *Stmt = *SI;
- if (NewScattering.find(Stmt) != NewScattering.end())
- Stmt->setScattering(NewScattering[Stmt]);
+ if (NewScattering.find(Stmt) != NewScattering.end())
+ Stmt->setScattering(NewScattering[Stmt]);
}
int statementIdx = 0;
@@ -268,15 +268,17 @@ bool JSONImporter::runOnScop(Scop &scop) {
["accesses"][memoryAccessIdx]["relation"];
isl_map *newAccessMap = isl_map_read_from_str(S->getIslCtx(),
accesses.asCString());
- isl_map *currentAccessMap = (*MI)->getAccessFunction();
+ isl_map *currentAccessMap = (*MI)->getAccessRelation();
if (!isl_map_has_equal_space(currentAccessMap, newAccessMap)) {
errs() << "JScop file contains access function with incompatible "
<< "dimensions\n";
+ isl_map_free(currentAccessMap);
isl_map_free(newAccessMap);
return false;
}
if (isl_map_dim(newAccessMap, isl_dim_out) != 1) {
errs() << "New access map in JScop file should be single dimensional\n";
+ isl_map_free(currentAccessMap);
isl_map_free(newAccessMap);
return false;
}
@@ -284,10 +286,11 @@ bool JSONImporter::runOnScop(Scop &scop) {
// Statistics.
++NewAccessMapFound;
newAccessStrings.push_back(accesses.asCString());
- (*MI)->setNewAccessFunction(newAccessMap);
+ (*MI)->setNewAccessRelation(newAccessMap);
} else {
isl_map_free(newAccessMap);
}
+ isl_map_free(currentAccessMap);
memoryAccessIdx++;
}
statementIdx++;
OpenPOWER on IntegriCloud