return -1 when polly::getNumberOfIterations returns -1

llvm-svn: 170422
This commit is contained in:
Sebastian Pop 2012-12-18 08:56:51 +00:00
parent 04c4ce32ae
commit 2aa5c24a3a
2 changed files with 8 additions and 2 deletions

View File

@ -770,7 +770,10 @@ bool ClastStmtCodeGen::isInnermostLoop(const clast_for *f) {
int ClastStmtCodeGen::getNumberOfIterations(const clast_for *For) {
isl_set *LoopDomain = isl_set_copy(isl_set_from_cloog_domain(For->domain));
return polly::getNumberOfIterations(LoopDomain) / isl_int_get_si(For->stride) + 1;
int NumberOfIterations = polly::getNumberOfIterations(LoopDomain);
if (NumberOfIterations == -1)
return -1;
return NumberOfIterations / isl_int_get_si(For->stride) + 1;
}
void ClastStmtCodeGen::codegenForVector(const clast_for *F) {

View File

@ -665,7 +665,10 @@ unsigned IslNodeBuilder::getNumberOfIterations(__isl_keep isl_ast_node *For) {
isl_union_map *Schedule = isl_ast_build_get_schedule(Info->Context);
isl_set *LoopDomain = isl_set_from_union_set(isl_union_map_range(Schedule));
isl_id_free(Annotation);
return polly::getNumberOfIterations(LoopDomain) + 1;
int NumberOfIterations = polly::getNumberOfIterations(LoopDomain);
if (NumberOfIterations == -1)
return -1;
return NumberOfIterations + 1;
}
void IslNodeBuilder::createUserVector(__isl_take isl_ast_node *User,