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
This commit is contained in:
parent
5d83f09cdd
commit
47b906c815
|
@ -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,
|
static __isl_give isl_ast_node *AtEachDomain(__isl_take isl_ast_node *Node,
|
||||||
__isl_keep isl_ast_build *Build,
|
__isl_keep isl_ast_build *Build,
|
||||||
void *User) {
|
void *User) {
|
||||||
IslAstUserPayload *Info = nullptr;
|
assert(!isl_ast_node_get_annotation(Node) && "Node already annotated");
|
||||||
isl_id *Id = isl_ast_node_get_annotation(Node);
|
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 (Id)
|
NodeInfo->Build = isl_ast_build_copy(Build);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Info->Build)
|
|
||||||
Info->Build = isl_ast_build_copy(Build);
|
|
||||||
|
|
||||||
return isl_ast_node_set_annotation(Node, Id);
|
return isl_ast_node_set_annotation(Node, Id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue