# Changeset View

Changeset View

# Standalone View

Standalone View

# polly/trunk/lib/Analysis/ScopInfo.cpp

Show First 20 Lines • Show All 3773 Lines • ▼ Show 20 Line(s) | |||||

3774 | 3774 | | |||

3775 | void Scop::recordAssumption(AssumptionKind Kind, isl::set Set, DebugLoc Loc, | 3775 | void Scop::recordAssumption(AssumptionKind Kind, isl::set Set, DebugLoc Loc, | ||

3776 | AssumptionSign Sign, BasicBlock *BB) { | 3776 | AssumptionSign Sign, BasicBlock *BB) { | ||

3777 | assert((Set.is_params() || BB) && | 3777 | assert((Set.is_params() || BB) && | ||

3778 | "Assumptions without a basic block must be parameter sets"); | 3778 | "Assumptions without a basic block must be parameter sets"); | ||

3779 | RecordedAssumptions.push_back({Kind, Sign, Set, Loc, BB}); | 3779 | RecordedAssumptions.push_back({Kind, Sign, Set, Loc, BB}); | ||

3780 | } | 3780 | } | ||

3781 | 3781 | | |||

3782 | void Scop::addRecordedAssumptions() { | | |||

3783 | while (!RecordedAssumptions.empty()) { | | |||

3784 | Assumption AS = RecordedAssumptions.pop_back_val(); | | |||

3785 | | ||||

3786 | if (!AS.BB) { | | |||

3787 | addAssumption(AS.Kind, AS.Set, AS.Loc, AS.Sign, nullptr /* BasicBlock */); | | |||

3788 | continue; | | |||

3789 | } | | |||

3790 | | ||||

3791 | // If the domain was deleted the assumptions are void. | | |||

3792 | isl_set *Dom = getDomainConditions(AS.BB).release(); | | |||

3793 | if (!Dom) | | |||

3794 | continue; | | |||

3795 | | ||||

3796 | // If a basic block was given use its domain to simplify the assumption. | | |||

3797 | // In case of restrictions we know they only have to hold on the domain, | | |||

3798 | // thus we can intersect them with the domain of the block. However, for | | |||

3799 | // assumptions the domain has to imply them, thus: | | |||

3800 | // _ _____ | | |||

3801 | // Dom => S <==> A v B <==> A - B | | |||

3802 | // | | |||

3803 | // To avoid the complement we will register A - B as a restriction not an | | |||

3804 | // assumption. | | |||

3805 | isl_set *S = AS.Set.copy(); | | |||

3806 | if (AS.Sign == AS_RESTRICTION) | | |||

3807 | S = isl_set_params(isl_set_intersect(S, Dom)); | | |||

3808 | else /* (AS.Sign == AS_ASSUMPTION) */ | | |||

3809 | S = isl_set_params(isl_set_subtract(Dom, S)); | | |||

3810 | | ||||

3811 | addAssumption(AS.Kind, isl::manage(S), AS.Loc, AS_RESTRICTION, AS.BB); | | |||

3812 | } | | |||

3813 | } | | |||

3814 | | ||||

3815 | void Scop::invalidate(AssumptionKind Kind, DebugLoc Loc, BasicBlock *BB) { | 3782 | void Scop::invalidate(AssumptionKind Kind, DebugLoc Loc, BasicBlock *BB) { | ||

3816 | LLVM_DEBUG(dbgs() << "Invalidate SCoP because of reason " << Kind << "\n"); | 3783 | LLVM_DEBUG(dbgs() << "Invalidate SCoP because of reason " << Kind << "\n"); | ||

3817 | addAssumption(Kind, isl::set::empty(getParamSpace()), Loc, AS_ASSUMPTION, BB); | 3784 | addAssumption(Kind, isl::set::empty(getParamSpace()), Loc, AS_ASSUMPTION, BB); | ||

3818 | } | 3785 | } | ||

3819 | 3786 | | |||

3820 | isl::set Scop::getInvalidContext() const { return InvalidContext; } | 3787 | isl::set Scop::getInvalidContext() const { return InvalidContext; } | ||

3821 | 3788 | | |||

3822 | void Scop::printContext(raw_ostream &OS) const { | 3789 | void Scop::printContext(raw_ostream &OS) const { | ||

▲ Show 20 Lines • Show All 872 Lines • Show Last 20 Lines |