summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@codeaurora.org>2014-07-29 08:59:56 +0000
committerJohannes Doerfert <jdoerfert@codeaurora.org>2014-07-29 08:59:56 +0000
commit47b906c8150c950892dc18b595e4e22d2e81e7f4 (patch)
treecab09eaf3ead55d96c06ade58d0a56a02a69afb0 /polly/lib/CodeGen
parent5d83f09cdd4eee9fa9d040bee12cab6326dfc850 (diff)
downloadbcm5719-llvm-47b906c8150c950892dc18b595e4e22d2e81e7f4.tar.gz
bcm5719-llvm-47b906c8150c950892dc18b595e4e22d2e81e7f4.zip
Assume no annotations when visiting new domain (IslAst)
Whe we build the IslAst we visit for nodes (in pre and post order) as well as user/domain nodes. As these two sets are non overlapping we do not need to check if we annotated a node earlier when we visit it. llvm-svn: 214170
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r--polly/lib/CodeGen/IslAst.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp
index 471cbb18247..091083534ac 100644
--- a/polly/lib/CodeGen/IslAst.cpp
+++ b/polly/lib/CodeGen/IslAst.cpp
@@ -239,22 +239,12 @@ astBuildAfterFor(__isl_take isl_ast_node *Node, __isl_keep isl_ast_build *Build,
static __isl_give isl_ast_node *AtEachDomain(__isl_take isl_ast_node *Node,
__isl_keep isl_ast_build *Build,
void *User) {
- IslAstUserPayload *Info = nullptr;
- isl_id *Id = isl_ast_node_get_annotation(Node);
-
- if (Id)
- Info = (IslAstUserPayload *)isl_id_get_user(Id);
-
- if (!Info) {
- // Allocate annotations once: parallel for detection might have already
- // allocated the annotations for this node.
- Info = new IslAstUserPayload();
- Id = isl_id_alloc(isl_ast_node_get_ctx(Node), nullptr, Info);
- Id = isl_id_set_free_user(Id, freeIslAstUserPayload);
- }
+ assert(!isl_ast_node_get_annotation(Node) && "Node already annotated");
+ IslAstUserPayload *NodeInfo = new IslAstUserPayload();
+ isl_id *Id = isl_id_alloc(isl_ast_build_get_ctx(Build), "", NodeInfo);
+ Id = isl_id_set_free_user(Id, freeIslAstUserPayload);
- if (!Info->Build)
- Info->Build = isl_ast_build_copy(Build);
+ NodeInfo->Build = isl_ast_build_copy(Build);
return isl_ast_node_set_annotation(Node, Id);
}
OpenPOWER on IntegriCloud