diff --git a/polly/include/polly/ScopBuilder.h b/polly/include/polly/ScopBuilder.h index dc29dcb944b7..1e433800b590 100644 --- a/polly/include/polly/ScopBuilder.h +++ b/polly/include/polly/ScopBuilder.h @@ -260,9 +260,10 @@ class ScopBuilder final { /// /// Note that this function will also adjust the invalid context /// accordingly. - __isl_give isl_pw_aff * - getPwAff(BasicBlock *BB, DenseMap &InvalidDomainMap, - const SCEV *E, bool NonNegative = false, bool IsInsideDomain = true); + isl::pw_aff getPwAff(BasicBlock *BB, + DenseMap &InvalidDomainMap, + const SCEV *E, bool NonNegative = false, + bool IsInsideDomain = true); /// Create equivalence classes for required invariant accesses. /// diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp index 8a143645a319..6a39c1f1c543 100644 --- a/polly/lib/Analysis/ScopBuilder.cpp +++ b/polly/lib/Analysis/ScopBuilder.cpp @@ -333,14 +333,14 @@ isl::set ScopBuilder::adjustDomainDimensions(isl::set Dom, Loop *OldL, return Dom; } -__isl_give isl_pw_aff * +isl::pw_aff ScopBuilder::getPwAff(BasicBlock *BB, DenseMap &InvalidDomainMap, const SCEV *E, bool NonNegative, bool IsInsideDomain) { PWACtx PWAC = scop->getPwAff(E, BB, NonNegative, &RecordedAssumptions, IsInsideDomain); InvalidDomainMap[BB] = InvalidDomainMap[BB].unite(PWAC.second); - return PWAC.first.release(); + return std::move(PWAC.first); } /// Build condition sets for unsigned ICmpInst(s). @@ -359,10 +359,12 @@ __isl_give isl_set *ScopBuilder::buildUnsignedConditionSets( // Do not take NonNeg assumption on TestVal // as it might have MSB (Sign bit) set. isl_pw_aff *TestVal = getPwAff(BB, InvalidDomainMap, SCEV_TestVal, - /*NonNegative=*/false, IsInsideDomain); + /*NonNegative=*/false, IsInsideDomain) + .release(); // Take NonNeg assumption on UpperBound. isl_pw_aff *UpperBound = getPwAff(BB, InvalidDomainMap, SCEV_UpperBound, - /*NonNegative=*/true, IsInsideDomain); + /*NonNegative=*/true, IsInsideDomain) + .release(); // 0 <= TestVal isl_set *First = @@ -390,7 +392,8 @@ bool ScopBuilder::buildConditionSets( isl_pw_aff *LHS, *RHS; LHS = getPwAff(BB, InvalidDomainMap, SE.getSCEVAtScope(Condition, L), - /*NonNegative=*/false, IsInsideDomain); + /*NonNegative=*/false, IsInsideDomain) + .release(); unsigned NumSuccessors = SI->getNumSuccessors(); ConditionSets.resize(NumSuccessors); @@ -399,7 +402,8 @@ bool ScopBuilder::buildConditionSets( ConstantInt *CaseValue = Case.getCaseValue(); RHS = getPwAff(BB, InvalidDomainMap, SE.getSCEV(CaseValue), - /*NonNegative=*/false, IsInsideDomain); + /*NonNegative=*/false, IsInsideDomain) + .release(); isl_set *CaseConditionSet = buildConditionSet(ICmpInst::ICMP_EQ, isl::manage_copy(LHS), isl::manage(RHS)) @@ -432,9 +436,11 @@ bool ScopBuilder::buildConditionSets( const SCEV *RHSSCEV = SE.getZero(LHSSCEV->getType()); bool NonNeg = false; isl_pw_aff *LHS = - getPwAff(BB, InvalidDomainMap, LHSSCEV, NonNeg, IsInsideDomain); + getPwAff(BB, InvalidDomainMap, LHSSCEV, NonNeg, IsInsideDomain) + .release(); isl_pw_aff *RHS = - getPwAff(BB, InvalidDomainMap, RHSSCEV, NonNeg, IsInsideDomain); + getPwAff(BB, InvalidDomainMap, RHSSCEV, NonNeg, IsInsideDomain) + .release(); ConsequenceCondSet = buildConditionSet(ICmpInst::ICMP_SLE, isl::manage(LHS), isl::manage(RHS)) .release(); @@ -518,9 +524,10 @@ bool ScopBuilder::buildConditionSets( /*IsStrictUpperBound=*/false, IsInsideDomain); break; default: - LHS = getPwAff(BB, InvalidDomainMap, LeftOperand, NonNeg, IsInsideDomain); - RHS = - getPwAff(BB, InvalidDomainMap, RightOperand, NonNeg, IsInsideDomain); + LHS = getPwAff(BB, InvalidDomainMap, LeftOperand, NonNeg, IsInsideDomain) + .release(); + RHS = getPwAff(BB, InvalidDomainMap, RightOperand, NonNeg, IsInsideDomain) + .release(); ConsequenceCondSet = buildConditionSet(ICond->getPredicate(), isl::manage(LHS), isl::manage(RHS)) .release();