Changeset View
Changeset View
Standalone View
Standalone View
include/polly/ScopInfo.h
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | enum AssumptionKind { | ||||
WRAPPING, | WRAPPING, | ||||
UNSIGNED, | UNSIGNED, | ||||
PROFITABLE, | PROFITABLE, | ||||
ERRORBLOCK, | ERRORBLOCK, | ||||
COMPLEXITY, | COMPLEXITY, | ||||
INFINITELOOP, | INFINITELOOP, | ||||
INVARIANTLOAD, | INVARIANTLOAD, | ||||
DELINEARIZATION, | DELINEARIZATION, | ||||
AVOIDSINGLEITERATION, | |||||
Meinersbur: Can you use something more descriptive? | |||||
Hmm, I'll change to TRIPCOUNT , how does that sound? sabuasal: Hmm, I'll change to TRIPCOUNT , how does that sound? | |||||
Not Done ReplyInline ActionsBetter, but still does not describe what the assumption is. Meinersbur: Better, but still does not describe what the assumption is. | |||||
I'll use AVOIDSINGLEITERATION :) sabuasal: I'll use AVOIDSINGLEITERATION :) | |||||
}; | }; | ||||
/// Enum to distinguish between assumptions and restrictions. | /// Enum to distinguish between assumptions and restrictions. | ||||
enum AssumptionSign { AS_ASSUMPTION, AS_RESTRICTION }; | enum AssumptionSign { AS_ASSUMPTION, AS_RESTRICTION }; | ||||
/// The different memory kinds used in Polly. | /// The different memory kinds used in Polly. | ||||
/// | /// | ||||
/// We distinguish between arrays and various scalar memory objects. We use | /// We distinguish between arrays and various scalar memory objects. We use | ||||
▲ Show 20 Lines • Show All 1,501 Lines • ▼ Show 20 Lines | public: | ||||
/// Get the isl AST build. | /// Get the isl AST build. | ||||
isl::ast_build getAstBuild() const { return Build; } | isl::ast_build getAstBuild() const { return Build; } | ||||
/// Restrict the domain of the statement. | /// Restrict the domain of the statement. | ||||
/// | /// | ||||
/// @param NewDomain The new statement domain. | /// @param NewDomain The new statement domain. | ||||
void restrictDomain(isl::set NewDomain); | void restrictDomain(isl::set NewDomain); | ||||
/// Set the domain of the statement. | |||||
/// | |||||
/// @param NewDomain The new statement domain. | |||||
void setDomain(isl::set NewDomain); | |||||
/// Get the loop for a dimension. | /// Get the loop for a dimension. | ||||
/// | /// | ||||
/// @param Dimension The dimension of the induction variable | /// @param Dimension The dimension of the induction variable | ||||
/// @return The loop at a certain dimension. | /// @return The loop at a certain dimension. | ||||
Loop *getLoopForDimension(unsigned Dimension) const; | Loop *getLoopForDimension(unsigned Dimension) const; | ||||
/// Align the parameters in the statement to the scop context | /// Align the parameters in the statement to the scop context | ||||
void realignParams(); | void realignParams(); | ||||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | private: | ||||
DenseMap<BasicBlock *, std::vector<ScopStmt *>> StmtMap; | DenseMap<BasicBlock *, std::vector<ScopStmt *>> StmtMap; | ||||
/// A map from instructions to SCoP statements. | /// A map from instructions to SCoP statements. | ||||
DenseMap<Instruction *, ScopStmt *> InstStmtMap; | DenseMap<Instruction *, ScopStmt *> InstStmtMap; | ||||
/// A map from basic blocks to their domains. | /// A map from basic blocks to their domains. | ||||
DenseMap<BasicBlock *, isl::set> DomainMap; | DenseMap<BasicBlock *, isl::set> DomainMap; | ||||
/// A set that contains restrictions added to eliminate singletons | |||||
/// from statement domains. | |||||
isl::set RestrictDomainParams; | |||||
/// Constraints on parameters. | /// Constraints on parameters. | ||||
isl::set Context = nullptr; | isl::set Context = nullptr; | ||||
/// The affinator used to translate SCEVs to isl expressions. | /// The affinator used to translate SCEVs to isl expressions. | ||||
SCEVAffinator Affinator; | SCEVAffinator Affinator; | ||||
using ArrayInfoMapTy = | using ArrayInfoMapTy = | ||||
std::map<std::pair<AssertingVH<const Value>, MemoryKind>, | std::map<std::pair<AssertingVH<const Value>, MemoryKind>, | ||||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | private: | ||||
/// @param InvalidDomainMap BB to InvalidDomain map for the BB of current | /// @param InvalidDomainMap BB to InvalidDomain map for the BB of current | ||||
/// region. | /// region. | ||||
/// | /// | ||||
/// @returns True if there was no problem and false otherwise. | /// @returns True if there was no problem and false otherwise. | ||||
bool addLoopBoundsToHeaderDomain( | bool addLoopBoundsToHeaderDomain( | ||||
Loop *L, LoopInfo &LI, | Loop *L, LoopInfo &LI, | ||||
DenseMap<BasicBlock *, isl::set> &InvalidDomainMap); | DenseMap<BasicBlock *, isl::set> &InvalidDomainMap); | ||||
/// Update statement domains and parameters to ignore the execution | |||||
/// of statements that have only one iteration. | |||||
void ignoreSingleIterationDomains(); | |||||
/// Ensure assumptions added to prevent execution of | |||||
/// statements of one iteration are preset in the AssumedContext. | |||||
void enforceAssumptionsForAvoidsingleIter(); | |||||
/// Compute the branching constraints for each basic block in @p R. | /// Compute the branching constraints for each basic block in @p R. | ||||
/// | /// | ||||
/// @param R The region we currently build branching conditions | /// @param R The region we currently build branching conditions | ||||
/// for. | /// for. | ||||
/// @param DT The DominatorTree for the current function. | /// @param DT The DominatorTree for the current function. | ||||
/// @param LI The LoopInfo for the current function. | /// @param LI The LoopInfo for the current function. | ||||
/// @param InvalidDomainMap BB to InvalidDomain map for the BB of current | /// @param InvalidDomainMap BB to InvalidDomain map for the BB of current | ||||
/// region. | /// region. | ||||
▲ Show 20 Lines • Show All 851 Lines • ▼ Show 20 Lines | #endif | ||||
/// @param Stmt The statement for which the conditions should be returned. | /// @param Stmt The statement for which the conditions should be returned. | ||||
isl::set getDomainConditions(const ScopStmt *Stmt) const; | isl::set getDomainConditions(const ScopStmt *Stmt) const; | ||||
/// Return the domain of @p BB. | /// Return the domain of @p BB. | ||||
/// | /// | ||||
/// @param BB The block for which the conditions should be returned. | /// @param BB The block for which the conditions should be returned. | ||||
isl::set getDomainConditions(BasicBlock *BB) const; | isl::set getDomainConditions(BasicBlock *BB) const; | ||||
/// Accessor function that returns RestrictDomainParams | |||||
isl::set getRestrictDomainParams() const { return RestrictDomainParams; } | |||||
/// Get a union set containing the iteration domains of all statements. | /// Get a union set containing the iteration domains of all statements. | ||||
isl::union_set getDomains() const; | isl::union_set getDomains() const; | ||||
/// Get a union map of all may-writes performed in the SCoP. | /// Get a union map of all may-writes performed in the SCoP. | ||||
isl::union_map getMayWrites(); | isl::union_map getMayWrites(); | ||||
/// Get a union map of all must-writes performed in the SCoP. | /// Get a union map of all must-writes performed in the SCoP. | ||||
isl::union_map getMustWrites(); | isl::union_map getMustWrites(); | ||||
▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines |
Can you use something more descriptive?