Always export the latest memory access relations

This allows us to export the results from transformations such as DeLICM.

llvm-svn: 307641
This commit is contained in:
Tobias Grosser 2017-07-11 10:10:13 +00:00
parent a2e5ecc1f3
commit 6a4c12fb33
3 changed files with 8 additions and 1 deletions

View File

@ -843,6 +843,9 @@ public:
/// Get an isl string representing a new access function, if available.
std::string getNewAccessRelationStr() const;
/// Get an isl string representing the latest access relation.
std::string getAccessRelationStr() const;
/// Get the original base address of this access (e.g. A for A[i+j]) when
/// detected.
///

View File

@ -710,6 +710,10 @@ std::string MemoryAccess::getNewAccessRelationStr() const {
return stringFromIslObj(NewAccessRelation);
}
std::string MemoryAccess::getAccessRelationStr() const {
return isl::manage(getAccessRelation()).to_str();
}
__isl_give isl_basic_map *
MemoryAccess::createBasicAccessMap(ScopStmt *Statement) {
isl_space *Space = isl_space_set_alloc(Statement->getIslCtx(), 0, 1);

View File

@ -202,7 +202,7 @@ Json::Value JSONExporter::getJSON(Scop &S) const {
Json::Value access;
access["kind"] = MA->isRead() ? "read" : "write";
access["relation"] = MA->getOriginalAccessRelationStr();
access["relation"] = MA->getAccessRelationStr();
statement["accesses"].append(access);
}