summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-09-05 07:46:47 +0000
committerTobias Grosser <tobias@grosser.es>2015-09-05 07:46:47 +0000
commit6f73008506ec923ff69309016fd28cb6121eb11d (patch)
treee7c752189ae63087c948a6826c6139dcb5074e3b
parent166c422952fd470b61121d6933a142276ff4093c (diff)
downloadbcm5719-llvm-6f73008506ec923ff69309016fd28cb6121eb11d.tar.gz
bcm5719-llvm-6f73008506ec923ff69309016fd28cb6121eb11d.zip
Allow the import of multi-dimensional access functions
Originally, we disallowed the import of multi-dimensional access functions due to our code generation not supporting the generation of new address expressions for multi-dimensional memory accesses. When building our run-time alias check infrastructure we added code generation support for multi-dimensional address calculations. Hence, we can now savely allow the import of new multi-dimensional access functions. llvm-svn: 246917
-rw-r--r--polly/include/polly/ScopInfo.h3
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp6
-rw-r--r--polly/lib/Exchange/JSONExporter.cpp6
-rw-r--r--polly/test/Isl/CodeGen/new_multidim_access___%bb1---%bb17.jscop21
4 files changed, 30 insertions, 6 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index 4c0ae064d2c..7599ffcfa26 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -386,6 +386,9 @@ public:
/// @brief Get an isl string representing the access function read from IR.
std::string getOriginalAccessRelationStr() const;
+ /// @brief Get an isl string representing a new access function, if available.
+ std::string getNewAccessRelationStr() const;
+
/// @brief Get the base address of this access (e.g. A for A[i+j]).
Value *getBaseAddr() const { return BaseAddr; }
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 32fb3dbdbc8..dd69da8b42b 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -324,6 +324,10 @@ __isl_give isl_map *MemoryAccess::getNewAccessRelation() const {
return isl_map_copy(NewAccessRelation);
}
+std::string MemoryAccess::getNewAccessRelationStr() const {
+ return stringFromIslObj(NewAccessRelation);
+}
+
__isl_give isl_basic_map *
MemoryAccess::createBasicAccessMap(ScopStmt *Statement) {
isl_space *Space = isl_space_set_alloc(Statement->getIslCtx(), 0, 1);
@@ -580,6 +584,8 @@ void MemoryAccess::print(raw_ostream &OS) const {
OS << "[Reduction Type: " << getReductionType() << "] ";
OS << "[Scalar: " << isScalar() << "]\n";
OS.indent(16) << getOriginalAccessRelationStr() << ";\n";
+ if (hasNewAccessRelation())
+ OS.indent(11) << "new: " << getNewAccessRelationStr() << ";\n";
}
void MemoryAccess::dump() const { print(errs()); }
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index de9a4f3299c..085742acceb 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -343,12 +343,6 @@ bool JSONImporter::runOnScop(Scop &S) {
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;
- }
auto NewAccessDomain = isl_map_domain(isl_map_copy(newAccessMap));
auto CurrentAccessDomain = isl_map_domain(isl_map_copy(currentAccessMap));
diff --git a/polly/test/Isl/CodeGen/new_multidim_access___%bb1---%bb17.jscop b/polly/test/Isl/CodeGen/new_multidim_access___%bb1---%bb17.jscop
new file mode 100644
index 00000000000..5ef5c7c8313
--- /dev/null
+++ b/polly/test/Isl/CodeGen/new_multidim_access___%bb1---%bb17.jscop
@@ -0,0 +1,21 @@
+{
+ "context" : "[n, m] -> { : n <= 9223372036854775807 and n >= -9223372036854775808 and m <= 9223372036854775807 and m >= -9223372036854775808 }",
+ "name" : "bb1 => bb17",
+ "statements" : [
+ {
+ "accesses" : [
+ {
+ "kind" : "read",
+ "relation" : "[n, m] -> { Stmt_bb4[i0, i1] -> MemRef_A[i0, i1 + 13] }"
+ },
+ {
+ "kind" : "write",
+ "relation" : "[n, m] -> { Stmt_bb4[i0, i1] -> MemRef_A[i0, i1 + 43] }"
+ }
+ ],
+ "domain" : "[n, m] -> { Stmt_bb4[i0, i1] : i0 >= 0 and n >= 1 and i0 <= -1 + n and i1 >= 0 and i1 <= 99 }",
+ "name" : "Stmt_bb4",
+ "schedule" : "[n, m] -> { Stmt_bb4[i0, i1] -> [i0, i1] }"
+ }
+ ]
+}
OpenPOWER on IntegriCloud