diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-09-05 13:03:57 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-09-05 13:03:57 +0000 |
| commit | abcec37f642cf875ae0d6d76d8f595b1d99950e9 (patch) | |
| tree | d996c23375e00ddf6ef109c8ece5cffbc4789b7e /polly/lib/CodeGen/IslNodeBuilder.cpp | |
| parent | a1ceba8ab4a0da0ec36b47f13d94f441709c08cd (diff) | |
| download | bcm5719-llvm-abcec37f642cf875ae0d6d76d8f595b1d99950e9.tar.gz bcm5719-llvm-abcec37f642cf875ae0d6d76d8f595b1d99950e9.zip | |
IslNodeBuilder: Only obtain the isl_ast_build, when needed
In the common case, the access functions are not modified, hence there is no
need to obtain the IslAstBuild context at all. This should not only be minimally
faster, but this also allows the IslNodeBuilder to work on asts that are not
annotated with isl_ast_builds as long as the memory accesses are not modified.
llvm-svn: 246928
Diffstat (limited to 'polly/lib/CodeGen/IslNodeBuilder.cpp')
| -rw-r--r-- | polly/lib/CodeGen/IslNodeBuilder.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 5c866a54b72..1a726dc9468 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -298,7 +298,7 @@ void IslNodeBuilder::createUserVector(__isl_take isl_ast_node *User, Schedule = isl_union_map_intersect_domain(Schedule, Domain); isl_map *S = isl_map_from_union_map(Schedule); - auto *NewAccesses = createNewAccesses(Stmt, IslAstInfo::getBuild(User)); + auto *NewAccesses = createNewAccesses(Stmt, User); createSubstitutionsVector(Expr, Stmt, VLTS, IVS, IteratorID); VectorBlockGenerator::generate(BlockGen, *Stmt, VLTS, S, NewAccesses); isl_id_to_ast_expr_free(NewAccesses); @@ -647,13 +647,15 @@ void IslNodeBuilder::createIf(__isl_take isl_ast_node *If) { __isl_give isl_id_to_ast_expr * IslNodeBuilder::createNewAccesses(ScopStmt *Stmt, - __isl_keep isl_ast_build *Build) { + __isl_keep isl_ast_node *Node) { isl_id_to_ast_expr *NewAccesses = - isl_id_to_ast_expr_alloc(isl_ast_build_get_ctx(Build), 0); + isl_id_to_ast_expr_alloc(Stmt->getParent()->getIslCtx(), 0); for (auto *MA : *Stmt) { if (!MA->hasNewAccessRelation()) continue; + auto Build = IslAstInfo::getBuild(Node); + assert(Build && "Could not obtain isl_ast_build from user node"); auto Schedule = isl_ast_build_get_schedule(Build); auto PWAccRel = MA->applyScheduleToAccessRelation(Schedule); @@ -714,7 +716,7 @@ void IslNodeBuilder::createUser(__isl_take isl_ast_node *User) { LTS.insert(OutsideLoopIterations.begin(), OutsideLoopIterations.end()); Stmt = (ScopStmt *)isl_id_get_user(Id); - auto *NewAccesses = createNewAccesses(Stmt, IslAstInfo::getBuild(User)); + auto *NewAccesses = createNewAccesses(Stmt, User); createSubstitutions(Expr, Stmt, LTS); if (Stmt->isBlockStmt()) |

