summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/IslCodeGeneration.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@codeaurora.org>2014-07-23 20:17:28 +0000
committerJohannes Doerfert <jdoerfert@codeaurora.org>2014-07-23 20:17:28 +0000
commitc4968e508b17b270ae3efdfa0f679b09887cf9e2 (patch)
tree9ab31a373a49a99296b6f2a93ed46ca90f09b2c4 /polly/lib/CodeGen/IslCodeGeneration.cpp
parent16ea3268b2c457eab685f8120c754d3d75f64ef2 (diff)
downloadbcm5719-llvm-c4968e508b17b270ae3efdfa0f679b09887cf9e2.tar.gz
bcm5719-llvm-c4968e508b17b270ae3efdfa0f679b09887cf9e2.zip
[Refactor] IslAst and payload struct
+ Renamed context into build when it's the isl_ast_build + Use the IslAstInfo functions to extract the schedule of a node + Use the IslAstInfo functions to extract the build/context of a node + Move the payload struct into the IslAstInfo class + Use a constructor and destructor (also new and delete) to allocate/initialize the payload struct llvm-svn: 213792
Diffstat (limited to 'polly/lib/CodeGen/IslCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/IslCodeGeneration.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp
index 4eb39cc362b..142324cbd11 100644
--- a/polly/lib/CodeGen/IslCodeGeneration.cpp
+++ b/polly/lib/CodeGen/IslCodeGeneration.cpp
@@ -778,20 +778,8 @@ IslNodeBuilder::getUpperBound(__isl_keep isl_ast_node *For,
}
unsigned IslNodeBuilder::getNumberOfIterations(__isl_keep isl_ast_node *For) {
- isl_id *Annotation = isl_ast_node_get_annotation(For);
- if (!Annotation)
- return -1;
-
- struct IslAstUserPayload *Info =
- (struct IslAstUserPayload *)isl_id_get_user(Annotation);
- if (!Info) {
- isl_id_free(Annotation);
- return -1;
- }
-
- isl_union_map *Schedule = isl_ast_build_get_schedule(Info->Context);
+ isl_union_map *Schedule = IslAstInfo::getSchedule(Build);
isl_set *LoopDomain = isl_set_from_union_set(isl_union_map_range(Schedule));
- isl_id_free(Annotation);
int NumberOfIterations = polly::getNumberOfIterations(LoopDomain);
if (NumberOfIterations == -1)
return -1;
@@ -848,14 +836,7 @@ void IslNodeBuilder::createForVector(__isl_take isl_ast_node *For,
for (int i = 1; i < VectorWidth; i++)
IVS[i] = Builder.CreateAdd(IVS[i - 1], ValueInc, "p_vector_iv");
- isl_id *Annotation = isl_ast_node_get_annotation(For);
- assert(Annotation && "For statement is not annotated");
-
- struct IslAstUserPayload *Info =
- (struct IslAstUserPayload *)isl_id_get_user(Annotation);
- assert(Info && "For statement annotation does not contain info");
-
- isl_union_map *Schedule = isl_ast_build_get_schedule(Info->Context);
+ isl_union_map *Schedule = IslAstInfo::getSchedule(Build);
assert(Schedule && "For statement annotation does not contain its schedule");
IDToValue[IteratorID] = ValueLB;
@@ -883,7 +864,6 @@ void IslNodeBuilder::createForVector(__isl_take isl_ast_node *For,
IDToValue.erase(IteratorID);
isl_id_free(IteratorID);
- isl_id_free(Annotation);
isl_union_map_free(Schedule);
isl_ast_node_free(For);
OpenPOWER on IntegriCloud