summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/IslCodeGeneration.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@codeaurora.org>2014-08-03 01:51:59 +0000
committerJohannes Doerfert <jdoerfert@codeaurora.org>2014-08-03 01:51:59 +0000
commita63b2579c6dabb7edae3ad38a4789659c962a7bf (patch)
treea034cd6ae351a453ce22836238b075a932e41091 /polly/lib/CodeGen/IslCodeGeneration.cpp
parented87831113c0edf32eb5c0e4d2e1f5d7d2f3d2a9 (diff)
downloadbcm5719-llvm-a63b2579c6dabb7edae3ad38a4789659c962a7bf.tar.gz
bcm5719-llvm-a63b2579c6dabb7edae3ad38a4789659c962a7bf.zip
Fix the modifiable access creation
+ Remove the class IslGenerator which duplicates the functionality of IslExprBuilder. + Use the IslExprBuilder to create code for memory access relations. + Also handle array types during access creation. + Enable scev codegen for one of the transformed memory access tests, thus access creation without canonical induction variables available. + Update one test case to the new output. llvm-svn: 214659
Diffstat (limited to 'polly/lib/CodeGen/IslCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/IslCodeGeneration.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp
index 90b73214bbe..361ef8ac5a5 100644
--- a/polly/lib/CodeGen/IslCodeGeneration.cpp
+++ b/polly/lib/CodeGen/IslCodeGeneration.cpp
@@ -19,6 +19,7 @@
//
//===----------------------------------------------------------------------===//
#include "polly/Config/config.h"
+#include "polly/CodeGen/IslExprBuilder.h"
#include "polly/CodeGen/BlockGenerators.h"
#include "polly/CodeGen/CodeGeneration.h"
#include "polly/CodeGen/IslAst.h"
@@ -61,6 +62,8 @@ public:
: Builder(Builder), Annotator(Annotator), ExprBuilder(Builder, IDToValue),
P(P) {}
+ /// @brief Add the mappings from array id's to array llvm::Value's.
+ void addMemoryAccesses(Scop &S);
void addParameters(__isl_take isl_set *Context);
void create(__isl_take isl_ast_node *Node);
IslExprBuilder &getExprBuilder() { return ExprBuilder; }
@@ -485,8 +488,10 @@ void IslNodeBuilder::createUser(__isl_take isl_ast_node *User) {
isl_ast_expr_free(StmtExpr);
Stmt = (ScopStmt *)isl_id_get_user(Id);
+
createSubstitutions(Expr, Stmt, VMap, LTS);
- BlockGenerator::generate(Builder, *Stmt, VMap, LTS, P);
+ BlockGenerator::generate(Builder, *Stmt, VMap, LTS, P,
+ IslAstInfo::getBuild(User), &ExprBuilder);
isl_ast_node_free(User);
isl_id_free(Id);
@@ -545,6 +550,15 @@ void IslNodeBuilder::addParameters(__isl_take isl_set *Context) {
isl_set_free(Context);
}
+void IslNodeBuilder::addMemoryAccesses(Scop &S) {
+ for (ScopStmt *Stmt : S)
+ for (MemoryAccess *MA : *Stmt) {
+ isl_id *Id = MA->getArrayId();
+ IDToValue[Id] = MA->getBaseAddr();
+ isl_id_free(Id);
+ }
+}
+
namespace {
class IslCodeGeneration : public ScopPass {
public:
@@ -570,6 +584,7 @@ public:
IslNodeBuilder NodeBuilder(Builder, Annotator, this);
Builder.SetInsertPoint(StartBlock->getSinglePredecessor()->begin());
+ NodeBuilder.addMemoryAccesses(S);
NodeBuilder.addParameters(S.getContext());
// Build condition that evaluates at run-time if all assumptions taken
// for the scop hold. If we detect some assumptions do not hold, the
OpenPOWER on IntegriCloud