Index: lib/Analysis/ScopInfo.cpp =================================================================== --- lib/Analysis/ScopInfo.cpp +++ lib/Analysis/ScopInfo.cpp @@ -174,12 +174,6 @@ cl::desc("Do not emit remarks about assumptions that are known"), cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::cat(PollyCategory)); -static cl::opt RunTimeChecksMaxAccessDisjuncts( - "polly-rtc-max-array-disjuncts", - cl::desc("The maximal number of disjunts allowed in memory accesses to " - "to build RTCs."), - cl::Hidden, cl::ZeroOrMore, cl::init(8), cl::cat(PollyCategory)); - static cl::opt RunTimeChecksMaxParameters( "polly-rtc-max-parameters", cl::desc("The maximal number of parameters allowed in RTCs."), cl::Hidden, @@ -2307,8 +2301,8 @@ unsigned Pos; isl::ctx Ctx = Set.get_ctx(); - Set = Set.remove_divs(); - + Set = Set.simple_hull(); + if (isl_set_n_basic_set(Set.get()) >= MaxDisjunctsInDomain) return isl::stat::error; @@ -2336,27 +2330,33 @@ return isl::stat::error; } - if (isl_set_n_basic_set(Set.get()) > RunTimeChecksMaxAccessDisjuncts) - return isl::stat::error; - MinPMA = Set.lexmin_pw_multi_aff(); MaxPMA = Set.lexmax_pw_multi_aff(); - if (isl_ctx_last_error(Ctx.get()) == isl_error_quota) + if(!MinPMA || !MaxPMA) + return isl::stat::error; + + if (isl_ctx_last_error(Ctx.get()) == isl_error_invalid || isl_ctx_last_error(Ctx.get()) == isl_error_quota) return isl::stat::error; MinPMA = MinPMA.coalesce(); MaxPMA = MaxPMA.coalesce(); + if (isl_ctx_last_error(Ctx.get()) == isl_error_quota) + return isl::stat::error; + + // Adjust the last dimension of the maximal access by one as we want to // enclose the accessed memory region by MinPMA and MaxPMA. The pointer // we test during code generation might now point after the end of the // allocated array but we will never dereference it anyway. - assert(MaxPMA.dim(isl::dim::out) && "Assumed at least one output dimension"); + assert(((!MaxPMA || !MinPMA) || MaxPMA.dim(isl::dim::out)) && "Assumed at least one output dimension"); + Pos = MaxPMA.dim(isl::dim::out) - 1; LastDimAff = MaxPMA.get_pw_aff(Pos); OneAff = isl::aff(isl::local_space(LastDimAff.get_domain_space())); OneAff = OneAff.add_constant_si(1); + LastDimAff = LastDimAff.add(OneAff); MaxPMA = MaxPMA.set_pw_aff(Pos, LastDimAff); @@ -2384,9 +2384,6 @@ Accesses = Accesses.intersect_domain(Domains); isl::union_set Locations = Accesses.range(); - Locations = Locations.coalesce(); - Locations = Locations.detect_equalities(); - auto Lambda = [&MinMaxAccesses, &S](isl::set Set) -> isl::stat { return buildMinMaxAccess(Set, MinMaxAccesses, S); }; @@ -3199,13 +3196,19 @@ { IslMaxOperationsGuard MaxOpGuard(getIslCtx().get(), OptComputeOut); bool Valid = buildAliasGroup(AG, HasWriteAccess); + + if (isl_ctx_last_error(getIslCtx().get()) == isl_error_quota) { + invalidate(COMPLEXITY, DebugLoc()); + return false; + } + if (!Valid) return false; } - if (isl_ctx_last_error(getIslCtx().get()) == isl_error_quota) { - invalidate(COMPLEXITY, DebugLoc()); - return false; - } +// if (isl_ctx_last_error(getIslCtx().get()) == isl_error_quota) { +// invalidate(COMPLEXITY, DebugLoc()); +// return false; +// } } return true;