summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/IslCodeGeneration.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-02-06 21:39:31 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-02-06 21:39:31 +0000
commitbe9c91173f7b9e2d05418ccd6bcfc92df35db84e (patch)
tree9e6f45c1ef851214a1abf3bc29f43ff035cc61be /polly/lib/CodeGen/IslCodeGeneration.cpp
parentf0bf1947b7c04ac8231009c604d17906ef0bc628 (diff)
downloadbcm5719-llvm-be9c91173f7b9e2d05418ccd6bcfc92df35db84e.tar.gz
bcm5719-llvm-be9c91173f7b9e2d05418ccd6bcfc92df35db84e.zip
[Refactor] Use only one BlockGenerator for a SCoP
This change has two main purposes: 1) We do not use a static interface to hide an object we create and destroy for every basic block we copy. 2) We allow the BlockGenerator to store information between calls to the copyBB method. This will ease scalar/phi code generation later on. While a lot of method signatures were changed this should not cause any real behaviour change. Differential Revision: http://reviews.llvm.org/D7467 llvm-svn: 228443
Diffstat (limited to 'polly/lib/CodeGen/IslCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/IslCodeGeneration.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp
index db8712b3920..45e8e9d06f6 100644
--- a/polly/lib/CodeGen/IslCodeGeneration.cpp
+++ b/polly/lib/CodeGen/IslCodeGeneration.cpp
@@ -64,7 +64,8 @@ public:
DominatorTree &DT, Scop &S)
: S(S), Builder(Builder), Annotator(Annotator),
Rewriter(new SCEVExpander(SE, "polly")),
- ExprBuilder(Builder, IDToValue, *Rewriter), P(P), DL(DL), LI(LI),
+ ExprBuilder(Builder, IDToValue, *Rewriter),
+ BlockGen(Builder, P, LI, SE, &ExprBuilder), P(P), DL(DL), LI(LI),
SE(SE), DT(DT) {}
~IslNodeBuilder() { delete Rewriter; }
@@ -82,6 +83,7 @@ private:
SCEVExpander *Rewriter;
IslExprBuilder ExprBuilder;
+ BlockGenerator BlockGen;
Pass *P;
const DataLayout &DL;
LoopInfo &LI;
@@ -398,6 +400,7 @@ void IslNodeBuilder::createUserVector(__isl_take isl_ast_node *User,
isl_id *Id = isl_ast_expr_get_id(StmtExpr);
isl_ast_expr_free(StmtExpr);
ScopStmt *Stmt = (ScopStmt *)isl_id_get_user(Id);
+ Stmt->setAstBuild(IslAstInfo::getBuild(User));
VectorValueMapT VectorMap(IVS.size());
std::vector<LoopToScevMapT> VLTS(IVS.size());
@@ -406,8 +409,7 @@ void IslNodeBuilder::createUserVector(__isl_take isl_ast_node *User,
isl_map *S = isl_map_from_union_map(Schedule);
createSubstitutionsVector(Expr, Stmt, VectorMap, VLTS, IVS, IteratorID);
- VectorBlockGenerator::generate(Builder, *Stmt, VectorMap, VLTS, S, P, LI, SE,
- IslAstInfo::getBuild(User), &ExprBuilder);
+ VectorBlockGenerator::generate(BlockGen, *Stmt, VectorMap, VLTS, S);
isl_map_free(S);
isl_id_free(Id);
@@ -795,10 +797,10 @@ void IslNodeBuilder::createUser(__isl_take isl_ast_node *User) {
LTS.insert(OutsideLoopIterations.begin(), OutsideLoopIterations.end());
Stmt = (ScopStmt *)isl_id_get_user(Id);
+ Stmt->setAstBuild(IslAstInfo::getBuild(User));
createSubstitutions(Expr, Stmt, VMap, LTS);
- BlockGenerator::generate(Builder, *Stmt, VMap, LTS, P, LI, SE,
- IslAstInfo::getBuild(User), &ExprBuilder);
+ BlockGen.copyBB(*Stmt, VMap, LTS);
isl_ast_node_free(User);
isl_id_free(Id);
OpenPOWER on IntegriCloud