diff options
39 files changed, 900 insertions, 897 deletions
diff --git a/polly/include/polly/Canonicalization.h b/polly/include/polly/Canonicalization.h index 6bd16fb6bbb..1d0fc96b8dc 100644 --- a/polly/include/polly/Canonicalization.h +++ b/polly/include/polly/Canonicalization.h @@ -14,7 +14,7 @@ namespace polly { -/// @brief Schedule a set of canonicalization passes to prepare for Polly +/// Schedule a set of canonicalization passes to prepare for Polly. /// /// The set of optimization passes was partially taken/copied from the /// set of default optimization passes in LLVM. It is used to bring the code diff --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h index 08697ae4ab9..32f69f555b0 100644 --- a/polly/include/polly/CodeGen/BlockGenerators.h +++ b/polly/include/polly/CodeGen/BlockGenerators.h @@ -38,22 +38,22 @@ class MemoryAccess; class ScopArrayInfo; class IslExprBuilder; -/// @brief Generate a new basic block for a polyhedral statement. +/// Generate a new basic block for a polyhedral statement. class BlockGenerator { public: typedef llvm::SmallVector<ValueMapT, 8> VectorValueMapT; - /// @brief Map types to resolve scalar dependences. + /// Map types to resolve scalar dependences. /// ///@{ /// @see The ScalarMap and PHIOpMap member. using ScalarAllocaMapTy = DenseMap<AssertingVH<Value>, AssertingVH<Value>>; - /// @brief Simple vector of instructions to store escape users. + /// Simple vector of instructions to store escape users. using EscapeUserVectorTy = SmallVector<Instruction *, 4>; - /// @brief Map type to resolve escaping users for scalar instructions. + /// Map type to resolve escaping users for scalar instructions. /// /// @see The EscapeMap member. using EscapeUsersAllocaMapTy = @@ -62,7 +62,7 @@ public: ///@} - /// @brief Create a generator for basic blocks. + /// Create a generator for basic blocks. /// /// @param Builder The LLVM-IR Builder used to generate the statement. The /// code is generated at the location, the Builder points @@ -83,7 +83,7 @@ public: ScalarAllocaMapTy &PHIOpMap, EscapeUsersAllocaMapTy &EscapeMap, ValueMapT &GlobalMap, IslExprBuilder *ExprBuilder = nullptr); - /// @brief Copy the basic block. + /// Copy the basic block. /// /// This copies the entire basic block and updates references to old values /// with references to new values, as defined by GlobalMap. @@ -97,7 +97,7 @@ public: void copyStmt(ScopStmt &Stmt, LoopToScevMapT <S, isl_id_to_ast_expr *NewAccesses); - /// @brief Return the scalar alloca for @p ScalarBase + /// Return the scalar alloca for @p ScalarBase. /// /// If no alloca was mapped to @p ScalarBase a new one is created. /// @@ -111,7 +111,7 @@ public: /// GlobalMap. Value *getOrCreateScalarAlloca(Value *ScalarBase); - /// @brief Remove a Value's allocation from the ScalarMap. + /// Remove a Value's allocation from the ScalarMap. /// /// This function allows to remove values from the ScalarMap. This is useful /// if the corresponding alloca instruction will be deleted (or moved into @@ -122,7 +122,7 @@ public: /// @param ScalarBase The value to remove. void freeScalarAlloc(Value *ScalarBase) { ScalarMap.erase(ScalarBase); } - /// @brief Return the PHi-node alloca for @p ScalarBase + /// Return the PHi-node alloca for @p ScalarBase. /// /// If no alloca was mapped to @p ScalarBase a new one is created. /// @@ -132,27 +132,27 @@ public: /// GlobalMap. Value *getOrCreatePHIAlloca(Value *ScalarBase); - /// @brief Return the alloca for @p Access + /// Return the alloca for @p Access. /// /// If no alloca was mapped for @p Access a new one is created. /// - /// @param Access The memory access for which to generate the alloca + /// @param Access The memory access for which to generate the alloca. /// /// @returns The alloca for @p Access or a replacement value taken from /// GlobalMap. Value *getOrCreateAlloca(const MemoryAccess &Access); - /// @brief Return the alloca for @p Array + /// Return the alloca for @p Array. /// /// If no alloca was mapped for @p Array a new one is created. /// - /// @param Array The array for which to generate the alloca + /// @param Array The array for which to generate the alloca. /// /// @returns The alloca for @p Array or a replacement value taken from /// GlobalMap. Value *getOrCreateAlloca(const ScopArrayInfo *Array); - /// @brief Finalize the code generation for the SCoP @p S. + /// Finalize the code generation for the SCoP @p S. /// /// This will initialize and finalize the scalar variables we demoted during /// the code generation. @@ -161,7 +161,7 @@ public: /// @see createScalarFinalization(Region &) void finalizeSCoP(Scop &S); - /// @brief An empty destructor + /// An empty destructor virtual ~BlockGenerator() {} BlockGenerator(const BlockGenerator &) = default; @@ -172,13 +172,13 @@ protected: ScalarEvolution &SE; IslExprBuilder *ExprBuilder; - /// @brief The dominator tree of this function. + /// The dominator tree of this function. DominatorTree &DT; - /// @brief The entry block of the current function. + /// The entry block of the current function. BasicBlock *EntryBB; - /// @brief Maps to resolve scalar dependences for PHI operands and scalars. + /// Maps to resolve scalar dependences for PHI operands and scalars. /// /// When translating code that contains scalar dependences as they result from /// inter-block scalar dependences (including the use of data carrying @@ -300,25 +300,25 @@ protected: /// ///{ /// - /// @brief Memory locations used for the special PHI node modeling. + /// Memory locations used for the special PHI node modeling. ScalarAllocaMapTy &PHIOpMap; - /// @brief Memory locations used to model scalar dependences. + /// Memory locations used to model scalar dependences. ScalarAllocaMapTy &ScalarMap; ///} - /// @brief Map from instructions to their escape users as well as the alloca. + /// Map from instructions to their escape users as well as the alloca. EscapeUsersAllocaMapTy &EscapeMap; - /// @brief A map from llvm::Values referenced in the old code to a new set of + /// A map from llvm::Values referenced in the old code to a new set of /// llvm::Values, which is used to replace these old values during /// code generation. ValueMapT &GlobalMap; - /// @brief Split @p BB to create a new one we can use to clone @p BB in. + /// Split @p BB to create a new one we can use to clone @p BB in. BasicBlock *splitBB(BasicBlock *BB); - /// @brief Copy the given basic block. + /// Copy the given basic block. /// /// @param Stmt The statement to code generate. /// @param BB The basic block to code generate. @@ -334,7 +334,7 @@ protected: BasicBlock *copyBB(ScopStmt &Stmt, BasicBlock *BB, ValueMapT &BBMap, LoopToScevMapT <S, isl_id_to_ast_expr *NewAccesses); - /// @brief Copy the given basic block. + /// Copy the given basic block. /// /// @param Stmt The statement to code generate. /// @param BB The basic block to code generate. @@ -350,7 +350,7 @@ protected: ValueMapT &BBMap, LoopToScevMapT <S, isl_id_to_ast_expr *NewAccesses); - /// @brief Return the alloca for @p ScalarBase in @p Map. + /// Return the alloca for @p ScalarBase in @p Map. /// /// If no alloca was mapped to @p ScalarBase in @p Map a new one is created /// and named after @p ScalarBase with the suffix @p NameExt. @@ -363,7 +363,7 @@ protected: Value *getOrCreateAlloca(Value *ScalarBase, ScalarAllocaMapTy &Map, const char *NameExt); - /// @brief Generate reload of scalars demoted to memory and needed by @p Stmt. + /// Generate reload of scalars demoted to memory and needed by @p Stmt. /// /// @param Stmt The statement we generate code for. /// @param LTS A mapping from loops virtual canonical induction @@ -374,7 +374,7 @@ protected: ValueMapT &BBMap, __isl_keep isl_id_to_ast_expr *NewAccesses); - /// @brief Generate the scalar stores for the given statement. + /// Generate the scalar stores for the given statement. /// /// After the statement @p Stmt was copied all inner-SCoP scalar dependences /// starting in @p Stmt (hence all scalar write accesses in @p Stmt) need to @@ -391,13 +391,13 @@ protected: ValueMapT &BBMap, __isl_keep isl_id_to_ast_expr *NewAccesses); - /// @brief Handle users of @p Inst outside the SCoP. + /// Handle users of @p Inst outside the SCoP. /// /// @param S The current SCoP. /// @param Inst The current instruction we check. void handleOutsideUsers(const Scop &S, Instruction *Inst); - /// @brief Find scalar statements that have outside users. + /// Find scalar statements that have outside users. /// /// We register these scalar values to later update subsequent scalar uses of /// these values to either use the newly computed value from within the scop @@ -407,12 +407,12 @@ protected: /// @param S The scop for which to find the outside users. void findOutsideUsers(Scop &S); - /// @brief Initialize the memory of demoted scalars. + /// Initialize the memory of demoted scalars. /// /// @param S The scop for which to generate the scalar initializers. void createScalarInitialization(Scop &S); - /// @brief Create exit PHI node merges for PHI nodes with more than two edges + /// Create exit PHI node merges for PHI nodes with more than two edges /// from inside the scop. /// /// For scops which have a PHI node in the exit block that has more than two @@ -428,14 +428,14 @@ protected: /// @param S The scop for which to generate the exiting PHI nodes. void createExitPHINodeMerges(Scop &S); - /// @brief Promote the values of demoted scalars after the SCoP. + /// Promote the values of demoted scalars after the SCoP. /// /// If a scalar value was used outside the SCoP we need to promote the value /// stored in the memory cell allocated for that scalar and combine it with /// the original value in the non-optimized SCoP. void createScalarFinalization(Scop &S); - /// @brief Try to synthesize a new value + /// Try to synthesize a new value /// /// Given an old value, we try to synthesize it in a new context from its /// original SCEV expression. We start from the original SCEV expression, @@ -459,7 +459,7 @@ protected: Value *trySynthesizeNewValue(ScopStmt &Stmt, Value *Old, ValueMapT &BBMap, LoopToScevMapT <S, Loop *L) const; - /// @brief Get the new version of a value. + /// Get the new version of a value. /// /// Given an old value, we first check if a new version of this value is /// available in the BBMap or GlobalMap. In case it is not and the value can @@ -489,10 +489,10 @@ protected: void copyInstScalar(ScopStmt &Stmt, Instruction *Inst, ValueMapT &BBMap, LoopToScevMapT <S); - /// @brief Get the innermost loop that surrounds the statement @p Stmt. + /// Get the innermost loop that surrounds the statement @p Stmt. Loop *getLoopForStmt(const ScopStmt &Stmt) const; - /// @brief Generate the operand address + /// Generate the operand address /// @param NewAccesses A map from memory access ids to new ast expressions, /// which may contain new access expressions for certain /// memory accesses. @@ -500,7 +500,7 @@ protected: ValueMapT &BBMap, LoopToScevMapT <S, isl_id_to_ast_expr *NewAccesses); - /// @brief Generate the operand address. + /// Generate the operand address. /// /// @param Stmt The statement to generate code for. /// @param L The innermost loop that surrounds the statement. @@ -520,7 +520,7 @@ protected: isl_id_to_ast_expr *NewAccesses, __isl_take isl_id *Id, Type *ExpectedType); - /// @brief Generate the pointer value that is accesses by @p Access. + /// Generate the pointer value that is accesses by @p Access. /// /// For write accesses, generate the target address. For read accesses, /// generate the source address. @@ -556,14 +556,14 @@ protected: LoopToScevMapT <S, isl_id_to_ast_expr *NewAccesses); - /// @brief Copy a single PHI instruction. + /// Copy a single PHI instruction. /// /// The implementation in the BlockGenerator is trivial, however it allows /// subclasses to handle PHIs different. virtual void copyPHIInstruction(ScopStmt &, PHINode *, ValueMapT &, LoopToScevMapT &) {} - /// @brief Copy a single Instruction. + /// Copy a single Instruction. /// /// This copies a single Instruction and updates references to old values /// with references to new values, as defined by GlobalMap and BBMap. @@ -585,18 +585,18 @@ protected: void copyInstruction(ScopStmt &Stmt, Instruction *Inst, ValueMapT &BBMap, LoopToScevMapT <S, isl_id_to_ast_expr *NewAccesses); - /// @brief Helper to determine if @p Inst can be synthesized in @p Stmt. + /// Helper to determine if @p Inst can be synthesized in @p Stmt. /// /// @returns false, iff @p Inst can be synthesized in @p Stmt. bool canSyntheziseInStmt(ScopStmt &Stmt, Instruction *Inst); - /// @brief Remove dead instructions generated for BB + /// Remove dead instructions generated for BB /// /// @param BB The basic block code for which code has been generated. /// @param BBMap A local map from old to new instructions. void removeDeadInstructions(BasicBlock *BB, ValueMapT &BBMap); - /// @brief Invalidate the scalar evolution expressions for a scop. + /// Invalidate the scalar evolution expressions for a scop. /// /// This function invalidates the scalar evolution results for all /// instructions that are part of a given scop. This is necessary to ensure @@ -609,12 +609,12 @@ protected: void invalidateScalarEvolution(Scop &S); }; -/// @brief Generate a new vector basic block for a polyhedral statement. +/// Generate a new vector basic block for a polyhedral statement. /// /// The only public function exposed is generate(). class VectorBlockGenerator : BlockGenerator { public: - /// @brief Generate a new vector basic block for a ScoPStmt. + /// Generate a new vector basic block for a ScoPStmt. /// /// This code generation is similar to the normal, scalar code generation, /// except that each instruction is code generated for several vector lanes @@ -676,7 +676,7 @@ private: Type *getVectorPtrTy(const Value *V, int Width); - /// @brief Load a vector from a set of adjacent scalars + /// Load a vector from a set of adjacent scalars /// /// In case a set of scalars is known to be next to each other in memory, /// create a vector load that loads those scalars @@ -699,7 +699,7 @@ private: __isl_keep isl_id_to_ast_expr *NewAccesses, bool NegativeStride); - /// @brief Load a vector initialized from a single scalar in memory + /// Load a vector initialized from a single scalar in memory /// /// In case all elements of a vector are initialized to the same /// scalar value, this value is loaded and shuffeled into all elements @@ -716,7 +716,7 @@ private: ValueMapT &BBMap, __isl_keep isl_id_to_ast_expr *NewAccesses); - /// @brief Load a vector from scalars distributed in memory + /// Load a vector from scalars distributed in memory /// /// In case some scalars a distributed randomly in memory. Create a vector /// by loading each scalar and by inserting one after the other into the @@ -766,14 +766,14 @@ private: bool hasVectorOperands(const Instruction *Inst, ValueMapT &VectorMap); - /// @brief Generate vector loads for scalars. + /// Generate vector loads for scalars. /// /// @param Stmt The scop statement for which to generate the loads. /// @param VectorBlockMap A map that will be updated to relate the original /// values with the newly generated vector loads. void generateScalarVectorLoads(ScopStmt &Stmt, ValueMapT &VectorBlockMap); - /// @brief Verify absence of scalar stores. + /// Verify absence of scalar stores. /// /// @param Stmt The scop statement to check for scalar stores. void verifyNoScalarStores(ScopStmt &Stmt); @@ -791,17 +791,17 @@ private: void copyStmt(ScopStmt &Stmt, __isl_keep isl_id_to_ast_expr *NewAccesses); }; -/// @brief Generator for new versions of polyhedral region statements. +/// Generator for new versions of polyhedral region statements. class RegionGenerator : public BlockGenerator { public: - /// @brief Create a generator for regions. + /// Create a generator for regions. /// /// @param BlockGen A generator for basic blocks. RegionGenerator(BlockGenerator &BlockGen) : BlockGenerator(BlockGen) {} virtual ~RegionGenerator() {} - /// @brief Copy the region statement @p Stmt. + /// Copy the region statement @p Stmt. /// /// This copies the entire region represented by @p Stmt and updates /// references to old values with references to new values, as defined by @@ -813,22 +813,22 @@ public: __isl_keep isl_id_to_ast_expr *IdToAstExp); private: - /// @brief A map from old to new blocks in the region. + /// A map from old to new blocks in the region. DenseMap<BasicBlock *, BasicBlock *> BlockMap; - /// @brief The "BBMaps" for the whole region (one for each block). + /// The "BBMaps" for the whole region (one for each block). DenseMap<BasicBlock *, ValueMapT> RegionMaps; - /// @brief Mapping to remember PHI nodes that still need incoming values. + /// Mapping to remember PHI nodes that still need incoming values. using PHINodePairTy = std::pair<const PHINode *, PHINode *>; DenseMap<BasicBlock *, SmallVector<PHINodePairTy, 4>> IncompletePHINodeMap; - /// @brief Repair the dominance tree after we created a copy block for @p BB. + /// Repair the dominance tree after we created a copy block for @p BB. /// /// @returns The immediate dominator in the DT for @p BBCopy if in the region. BasicBlock *repairDominance(BasicBlock *BB, BasicBlock *BBCopy); - /// @brief Add the new operand from the copy of @p IncomingBB to @p PHICopy. + /// Add the new operand from the copy of @p IncomingBB to @p PHICopy. /// /// @param Stmt The statement to code generate. /// @param PHI The original PHI we copy. @@ -839,8 +839,8 @@ private: void addOperandToPHI(ScopStmt &Stmt, const PHINode *PHI, PHINode *PHICopy, BasicBlock *IncomingBB, LoopToScevMapT <S); - /// @brief Create a PHI that combines the incoming values from all incoming - /// blocks that are in the subregion. + /// Create a PHI that combines the incoming values from all incoming blocks + /// that are in the subregion. /// /// PHIs in the subregion's exit block can have incoming edges from within and /// outside the subregion. This function combines the incoming values from @@ -872,7 +872,7 @@ private: /// @see buildExitPHI Value *getExitScalar(MemoryAccess *MA, LoopToScevMapT <S, ValueMapT &BBMap); - /// @brief Generate the scalar stores for the given statement. + /// Generate the scalar stores for the given statement. /// /// After the statement @p Stmt was copied all inner-SCoP scalar dependences /// starting in @p Stmt (hence all scalar write accesses in @p Stmt) need to @@ -889,7 +889,7 @@ private: generateScalarStores(ScopStmt &Stmt, LoopToScevMapT <S, ValueMapT &BBMAp, __isl_keep isl_id_to_ast_expr *NewAccesses) override; - /// @brief Copy a single PHI instruction. + /// Copy a single PHI instruction. /// /// This copies a single PHI instruction and updates references to old values /// with references to new values, as defined by GlobalMap and BBMap. diff --git a/polly/include/polly/CodeGen/IRBuilder.h b/polly/include/polly/CodeGen/IRBuilder.h index 4367405b782..97adbdf49ba 100644 --- a/polly/include/polly/CodeGen/IRBuilder.h +++ b/polly/include/polly/CodeGen/IRBuilder.h @@ -26,7 +26,7 @@ class ScalarEvolution; namespace polly { class Scop; -/// @brief Helper class to annotate newly generated SCoPs with metadata. +/// Helper class to annotate newly generated SCoPs with metadata. /// /// The annotations are twofold: /// 1) Loops are stored in a stack-like structure in the order they are @@ -44,23 +44,23 @@ class ScopAnnotator { public: ScopAnnotator(); - /// @brief Build all alias scopes for the given SCoP. + /// Build all alias scopes for the given SCoP. void buildAliasScopes(Scop &S); - /// @brief Add a new loop @p L which is parallel if @p IsParallel is true. + /// Add a new loop @p L which is parallel if @p IsParallel is true. void pushLoop(llvm::Loop *L, bool IsParallel); - /// @brief Remove the last added loop. + /// Remove the last added loop. void popLoop(bool isParallel); - /// @brief Annotate the new instruction @p I for all parallel loops. + /// Annotate the new instruction @p I for all parallel loops. void annotate(llvm::Instruction *I); - /// @brief Annotate the loop latch @p B wrt. @p L. + /// Annotate the loop latch @p B wrt. @p L. void annotateLoopLatch(llvm::BranchInst *B, llvm::Loop *L, bool IsParallel) const; - /// @brief Add alternative alias based pointers + /// Add alternative alias based pointers /// /// When annotating instructions with alias scope metadata, the right metadata /// is identified through the base pointer of the memory access. In some cases @@ -77,26 +77,26 @@ public: AlternativeAliasBases.insert(NewMap.begin(), NewMap.end()); } - /// @brief Delete the set of alternative alias bases + /// Delete the set of alternative alias bases void resetAlternativeAliasBases() { AlternativeAliasBases.clear(); } private: - /// @brief The ScalarEvolution analysis we use to find base pointers. + /// The ScalarEvolution analysis we use to find base pointers. llvm::ScalarEvolution *SE; - /// @brief All loops currently under construction. + /// All loops currently under construction. llvm::SmallVector<llvm::Loop *, 8> ActiveLoops; - /// @brief Metadata pointing to parallel loops currently under construction. + /// Metadata pointing to parallel loops currently under construction. llvm::SmallVector<llvm::MDNode *, 8> ParallelLoops; - /// @brief The alias scope domain for the current SCoP. + /// The alias scope domain for the current SCoP. llvm::MDNode *AliasScopeDomain; - /// @brief A map from base pointers to its alias scope. + /// A map from base pointers to its alias scope. llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::MDNode *> AliasScopeMap; - /// @brief A map from base pointers to an alias scope list of other pointers. + /// A map from base pointers to an alias scope list of other pointers. llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::MDNode *> OtherAliasScopeListMap; @@ -104,7 +104,7 @@ private: AlternativeAliasBases; }; -/// @brief Add Polly specifics when running IRBuilder. +/// Add Polly specifics when running IRBuilder. /// /// This is used to add additional items such as e.g. the llvm.loop.parallel /// metadata. @@ -132,7 +132,7 @@ private: // matches for certain names. typedef llvm::IRBuilder<llvm::ConstantFolder, IRInserter> PollyIRBuilder; -/// @brief Return an IR builder pointed before the @p BB terminator. +/// Return an IR builder pointed before the @p BB terminator. static inline PollyIRBuilder createPollyIRBuilder(llvm::BasicBlock *BB, ScopAnnotator &LA) { PollyIRBuilder Builder(BB->getContext(), llvm::ConstantFolder(), diff --git a/polly/include/polly/CodeGen/IslAst.h b/polly/include/polly/CodeGen/IslAst.h index 3903cf2a0c5..22fc80b3af4 100644 --- a/polly/include/polly/CodeGen/IslAst.h +++ b/polly/include/polly/CodeGen/IslAst.h @@ -53,10 +53,10 @@ public: __isl_give isl_ast_node *getAst(); - /// @brief Get the run-time conditions for the Scop. + /// Get the run-time conditions for the Scop. __isl_give isl_ast_expr *getRunCondition(); - /// @brief Build run-time condition for scop. + /// Build run-time condition for scop. /// /// @param S The scop to build the condition for. /// @param Build The isl_build object to use to build the condition. @@ -79,36 +79,36 @@ class IslAstInfo : public ScopPass { public: using MemoryAccessSet = SmallPtrSet<MemoryAccess *, 4>; - /// @brief Payload information used to annotate an AST node. + /// Payload information used to annotate an AST node. struct IslAstUserPayload { - /// @brief Construct and initialize the payload. + /// Construct and initialize the payload. IslAstUserPayload() : IsInnermost(false), IsInnermostParallel(false), IsOutermostParallel(false), IsReductionParallel(false), MinimalDependenceDistance(nullptr), Build(nullptr) {} - /// @brief Cleanup all isl structs on destruction. + /// Cleanup all isl structs on destruction. ~IslAstUserPayload(); - /// @brief Flag to mark innermost loops. + /// Flag to mark innermost loops. bool IsInnermost; - /// @brief Flag to mark innermost parallel loops. + /// Flag to mark innermost parallel loops. bool IsInnermostParallel; - /// @brief Flag to mark outermost parallel loops. + /// Flag to mark outermost parallel loops. bool IsOutermostParallel; - /// @brief Flag to mark parallel loops which break reductions. + /// Flag to mark parallel loops which break reductions. bool IsReductionParallel; - /// @brief The minimal dependence distance for non parallel loops. + /// The minimal dependence distance for non parallel loops. isl_pw_aff *MinimalDependenceDistance; - /// @brief The build environment at the time this node was constructed. + /// The build environment at the time this node was constructed. isl_ast_build *Build; - /// @brief Set of accesses which break reduction dependences. + /// Set of accesses which break reduction dependences. MemoryAccessSet BrokenReductions; }; @@ -120,22 +120,22 @@ public: static char ID; IslAstInfo() : ScopPass(ID), S(nullptr), Ast(nullptr) {} - /// @brief Build the AST for the given SCoP @p S. + /// Build the AST for the given SCoP @p S. bool runOnScop(Scop &S) override; - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; - /// @brief Release the internal memory. + /// Release the internal memory. void releaseMemory() override; - /// @brief Print a source code representation of the program. + /// Print a source code representation of the program. void printScop(llvm::raw_ostream &OS, Scop &S) const override; - /// @brief Return a copy of the AST root node. + /// Return a copy of the AST root node. __isl_give isl_ast_node *getAst() const; - /// @brief Get the run condition. + /// Get the run condition. /// /// Only if the run condition evaluates at run-time to a non-zero value, the /// assumptions that have been taken hold. If the run condition evaluates to @@ -147,38 +147,38 @@ public: /// ///{ - /// @brief Get the complete payload attached to @p Node. + /// Get the complete payload attached to @p Node. static IslAstUserPayload *getNodePayload(__isl_keep isl_ast_node *Node); - /// @brief Is this loop an innermost loop? + /// Is this loop an innermost loop? static bool isInnermost(__isl_keep isl_ast_node *Node); - /// @brief Is this loop a parallel loop? + /// Is this loop a parallel loop? static bool isParallel(__isl_keep isl_ast_node *Node); - /// @brief Is this loop an outermost parallel loop? + /// Is this loop an outermost parallel loop? static bool isOutermostParallel(__isl_keep isl_ast_node *Node); - /// @brief Is this loop an innermost parallel loop? + /// Is this loop an innermost parallel loop? static bool isInnermostParallel(__isl_keep isl_ast_node *Node); - /// @brief Is this loop a reduction parallel loop? + /// Is this loop a reduction parallel loop? static bool isReductionParallel(__isl_keep isl_ast_node *Node); - /// @brief Will the loop be run as thread parallel? + /// Will the loop be run as thread parallel? static bool isExecutedInParallel(__isl_keep isl_ast_node *Node); - /// @brief Get the nodes schedule or a nullptr if not available. + /// Get the nodes schedule or a nullptr if not available. static __isl_give isl_union_map *getSchedule(__isl_keep isl_ast_node *Node); - /// @brief Get minimal dependence distance or nullptr if not available. + /// Get minimal dependence distance or nullptr if not available. static __isl_give isl_pw_aff * getMinimalDependenceDistance(__isl_keep isl_ast_node *Node); - /// @brief Get the nodes broken reductions or a nullptr if not available. + /// Get the nodes broken reductions or a nullptr if not available. static MemoryAccessSet *getBrokenReductions(__isl_keep isl_ast_node *Node); - /// @brief Get the nodes build context or a nullptr if not available. + /// Get the nodes build context or a nullptr if not available. static __isl_give isl_ast_build *getBuild(__isl_keep isl_ast_node *Node); ///} diff --git a/polly/include/polly/CodeGen/IslExprBuilder.h b/polly/include/polly/CodeGen/IslExprBuilder.h index b9e6c38fb9e..a20fc6c172d 100644 --- a/polly/include/polly/CodeGen/IslExprBuilder.h +++ b/polly/include/polly/CodeGen/IslExprBuilder.h @@ -41,7 +41,7 @@ public: namespace polly { class ScopArrayInfo; -/// @brief LLVM-IR generator for isl_ast_expr[essions] +/// LLVM-IR generator for isl_ast_expr[essions] /// /// This generator generates LLVM-IR that performs the computation described by /// an isl_ast_expr[ession]. @@ -90,12 +90,12 @@ class ScopArrayInfo; /// class IslExprBuilder { public: - /// @brief A map from isl_ids to llvm::Values. + /// A map from isl_ids to llvm::Values. typedef llvm::MapVector<isl_id *, llvm::AssertingVH<llvm::Value>> IDToValueTy; typedef llvm::MapVector<isl_id *, const ScopArrayInfo *> IDToScopArrayInfoTy; - /// @brief A map from isl_ids to ScopArrayInfo objects. + /// A map from isl_ids to ScopArrayInfo objects. /// /// This map is used to obtain ScopArrayInfo objects for isl_ids which do not /// carry a ScopArrayInfo object in their user pointer. This is useful if the @@ -107,12 +107,12 @@ public: /// code generation. IDToScopArrayInfoTy *IDToSAI = nullptr; - /// @brief Set the isl_id to ScopArrayInfo map. + /// Set the isl_id to ScopArrayInfo map. /// /// @param NewIDToSAI The new isl_id to ScopArrayInfo map to use. void setIDToSAI(IDToScopArrayInfoTy *NewIDToSAI) { IDToSAI = NewIDToSAI; } - /// @brief Construct an IslExprBuilder. + /// Construct an IslExprBuilder. /// /// @param Builder The IRBuilder used to construct the isl_ast_expr[ession]. /// The insert location of this IRBuilder defines WHERE the @@ -127,14 +127,14 @@ public: llvm::ScalarEvolution &SE, llvm::DominatorTree &DT, llvm::LoopInfo &LI); - /// @brief Create LLVM-IR for an isl_ast_expr[ession]. + /// Create LLVM-IR for an isl_ast_expr[ession]. /// /// @param Expr The ast expression for which we generate LLVM-IR. /// /// @return The llvm::Value* containing the result of the computation. llvm::Value *create(__isl_take isl_ast_expr *Expr); - /// @brief Return the largest of two types. + /// Return the largest of two types. /// /// @param T1 The first type. /// @param T2 The second type. @@ -142,7 +142,7 @@ public: /// @return The largest of the two types. llvm::Type *getWidestType(llvm::Type *T1, llvm::Type *T2); - /// @brief Return the type with which this expression should be computed. + /// Return the type with which this expression should be computed. /// /// The type needs to be large enough to hold all possible input and all /// possible output values. @@ -151,7 +151,7 @@ public: /// @return The type with which the expression should be computed. llvm::IntegerType *getType(__isl_keep isl_ast_expr *Expr); - /// @brief Change if runtime overflows are tracked or not. + /// Change if runtime overflows are tracked or not. /// /// @param Enable Flag to enable/disable the tracking. /// @@ -159,7 +159,7 @@ public: /// allowed if the last tracked expression dominates the current insert point. void setTrackOverflow(bool Enable); - /// @brief Return the current overflow status or nullptr if it is not tracked. + /// Return the current overflow status or nullptr if it is not tracked. /// /// @return A nullptr if tracking is disabled or otherwise an i1 that has the /// value of "0" if and only if no overflow happened since tracking @@ -169,7 +169,7 @@ public: private: Scop &S; - /// @brief Flag that will be set if an overflow occurred at runtime. + /// Flag that will be set if an overflow occurred at runtime. /// /// Note that this flag is by default a nullptr and if it is a nullptr /// we will not record overflows but simply perform the computations. @@ -205,7 +205,7 @@ private: llvm::Value *createOpAddressOf(__isl_take isl_ast_expr *Expr); llvm::Value *createAccessAddress(__isl_take isl_ast_expr *Expr); - /// @brief Create a binary operation @p Opc and track overflows if requested. + /// Create a binary operation @p Opc and track overflows if requested. /// /// @param OpC The binary operation that should be performed [Add/Sub/Mul]. /// @param LHS The left operand. @@ -217,7 +217,7 @@ private: llvm::Value *LHS, llvm::Value *RHS, const llvm::Twine &Name); - /// @brief Create an addition and track overflows if requested. + /// Create an addition and track overflows if requested. /// /// @param LHS The left operand. /// @param RHS The right operand. @@ -227,7 +227,7 @@ private: llvm::Value *createAdd(llvm::Value *LHS, llvm::Value *RHS, const llvm::Twine &Name = ""); - /// @brief Create a subtraction and track overflows if requested. + /// Create a subtraction and track overflows if requested. /// /// @param LHS The left operand. /// @param RHS The right operand. @@ -237,7 +237,7 @@ private: llvm::Value *createSub(llvm::Value *LHS, llvm::Value *RHS, const llvm::Twine &Name = ""); - /// @brief Create a multiplication and track overflows if requested. + /// Create a multiplication and track overflows if requested. /// /// @param LHS The left operand. /// @param RHS The right operand. diff --git a/polly/include/polly/CodeGen/IslNodeBuilder.h b/polly/include/polly/CodeGen/IslNodeBuilder.h index 1a7e50cad91..b74b17e48e5 100644 --- a/polly/include/polly/CodeGen/IslNodeBuilder.h +++ b/polly/include/polly/CodeGen/IslNodeBuilder.h @@ -67,7 +67,7 @@ public: void addParameters(__isl_take isl_set *Context); - /// @brief Generate code that evaluates @p Condition at run-time. + /// Generate code that evaluates @p Condition at run-time. /// /// This function is typically called to generate the LLVM-IR for the /// run-time condition of the scop, that verifies that all the optimistic @@ -82,25 +82,25 @@ public: void create(__isl_take isl_ast_node *Node); - /// @brief Allocate memory for all new arrays created by Polly. + /// Allocate memory for all new arrays created by Polly. void allocateNewArrays(); - /// @brief Preload all memory loads that are invariant. + /// Preload all memory loads that are invariant. bool preloadInvariantLoads(); - /// @brief Finalize code generation. + /// Finalize code generation. /// /// @see BlockGenerator::finalizeSCoP(Scop &S) virtual void finalize() { BlockGen.finalizeSCoP(S); } IslExprBuilder &getExprBuilder() { return ExprBuilder; } - /// @brief Get the associated block generator. + /// Get the associated block generator. /// /// @return A referecne to the associated block generator. BlockGenerator &getBlockGenerator() { return BlockGen; } - /// @brief Return the parallel subfunctions that have been created. + /// Return the parallel subfunctions that have been created. const ArrayRef<Function *> getParallelSubfunctions() const { return ParallelSubfunctions; } @@ -112,25 +112,25 @@ protected: IslExprBuilder ExprBuilder; - /// @brief Maps used by the block and region generator to demote scalars. + /// Maps used by the block and region generator to demote scalars. /// ///@{ - /// @brief See BlockGenerator::ScalarMap. + /// See BlockGenerator::ScalarMap. BlockGenerator::ScalarAllocaMapTy ScalarMap; - /// @brief See BlockGenerator::PhiOpMap. + /// See BlockGenerator::PhiOpMap. BlockGenerator::ScalarAllocaMapTy PHIOpMap; - /// @brief See BlockGenerator::EscapeMap. + /// See BlockGenerator::EscapeMap. BlockGenerator::EscapeUsersAllocaMapTy EscapeMap; ///@} - /// @brief The generator used to copy a basic block. + /// The generator used to copy a basic block. BlockGenerator BlockGen; - /// @brief The generator used to copy a non-affine region. + /// The generator used to copy a non-affine region. RegionGenerator RegionGen; Pass *const P; @@ -139,7 +139,7 @@ protected: ScalarEvolution &SE; DominatorTree &DT; - /// @brief The current iteration of out-of-scop loops + /// The current iteration of out-of-scop loops /// /// This map provides for a given loop a llvm::Value that contains the current /// loop iteration. @@ -150,7 +150,7 @@ protected: // ivs. IslExprBuilder::IDToValueTy IDToValue; - /// @brief A collection of all parallel subfunctions that have been created. + /// A collection of all parallel subfunctions that have been created. SmallVector<Function *, 8> ParallelSubfunctions; /// Generate code for a given SCEV* @@ -168,12 +168,12 @@ protected: /// llvm::Values to new llvm::Values. ValueMapT ValueMap; - /// @brief Materialize code for @p Id if it was not done before. + /// Materialize code for @p Id if it was not done before. /// /// @returns False, iff a problem occured and the value was not materialized. bool materializeValue(__isl_take isl_id *Id); - /// @brief Materialize parameters of @p Set. + /// Materialize parameters of @p Set. /// /// @param All If not set only parameters referred to by the constraints in /// @p Set will be materialized, otherwise all. @@ -248,7 +248,7 @@ protected: /// @param NewValues A map that maps certain llvm::Values to new llvm::Values. void updateValues(ValueMapT &NewValues); - /// @brief Generate code for a marker now. + /// Generate code for a marker now. /// /// For mark nodes with an unknown name, we just forward the code generation /// to its child. This is currently the only behavior implemented, as there is @@ -258,18 +258,18 @@ protected: virtual void createMark(__isl_take isl_ast_node *Marker); virtual void createFor(__isl_take isl_ast_node *For); - /// @brief Set to remember materialized invariant loads. + /// Set to remember materialized invariant loads. /// /// An invariant load is identified by its pointer (the SCEV) and its type. SmallSet<std::pair<const SCEV *, Type *>, 16> PreloadedPtrs; - /// @brief Preload the memory access at @p AccessRange with @p Build. + /// Preload the memory access at @p AccessRange with @p Build. /// /// @returns The preloaded value casted to type @p Ty Value *preloadUnconditionally(__isl_take isl_set *AccessRange, isl_ast_build *Build, Instruction *AccInst); - /// @brief Preload the memory load access @p MA. + /// Preload the memory load access @p MA. /// /// If @p MA is not always executed it will be conditionally loaded and /// merged with undef from the same type. Hence, if @p MA is executed only @@ -282,7 +282,7 @@ protected: Value *preloadInvariantLoad(const MemoryAccess &MA, __isl_take isl_set *Domain); - /// @brief Preload the invariant access equivalence class @p IAClass + /// Preload the invariant access equivalence class @p IAClass /// /// This function will preload the representing load from @p IAClass and /// map all members of @p IAClass to that preloaded value, potentially casted @@ -299,7 +299,7 @@ protected: /// @param For The FOR isl_ast_node for which code is generated. void createForParallel(__isl_take isl_ast_node *For); - /// @brief Create new access functions for modified memory accesses. + /// Create new access functions for modified memory accesses. /// /// In case the access function of one of the memory references in the Stmt /// has been modified, we generate a new isl_ast_expr that reflects the @@ -363,7 +363,7 @@ protected: virtual void createUser(__isl_take isl_ast_node *User); virtual void createBlock(__isl_take isl_ast_node *Block); - /// @brief Get the schedule for a given AST node. + /// Get the schedule for a given AST node. /// /// This information is used to reason about parallelism of loops or the /// locality of memory accesses under a given schedule. diff --git a/polly/include/polly/CodeGen/LoopGenerators.h b/polly/include/polly/CodeGen/LoopGenerators.h index 70eeaa2d510..a991a93fe1d 100644 --- a/polly/include/polly/CodeGen/LoopGenerators.h +++ b/polly/include/polly/CodeGen/LoopGenerators.h @@ -29,7 +29,7 @@ class BasicBlock; namespace polly { using namespace llvm; -/// @brief Create a scalar do/for-style loop. +/// Create a scalar do/for-style loop. /// /// @param LowerBound The starting value of the induction variable. /// @param UpperBound The upper bound of the induction variable. @@ -56,7 +56,7 @@ Value *createLoop(Value *LowerBound, Value *UpperBound, Value *Stride, ScopAnnotator *Annotator = NULL, bool Parallel = false, bool UseGuard = true); -/// @brief The ParallelLoopGenerator allows to create parallelized loops +/// The ParallelLoopGenerator allows to create parallelized loops /// /// To parallelize a loop, we perform the following steps: /// o Generate a subfunction which will hold the loop body. @@ -98,7 +98,7 @@ Value *createLoop(Value *LowerBound, Value *UpperBound, Value *Stride, /// } class ParallelLoopGenerator { public: - /// @brief Create a parallel loop generator for the current function. + /// Create a parallel loop generator for the current function. ParallelLoopGenerator(PollyIRBuilder &Builder, Pass *P, LoopInfo &LI, DominatorTree &DT, const DataLayout &DL) : Builder(Builder), P(P), LI(LI), DT(DT), DL(DL), @@ -106,7 +106,7 @@ public: Type::getIntNTy(Builder.getContext(), DL.getPointerSizeInBits())), M(Builder.GetInsertBlock()->getParent()->getParent()) {} - /// @brief Create a parallel loop. + /// Create a parallel loop. /// /// This function is the main function to automatically generate a parallel /// loop with all its components. @@ -128,25 +128,25 @@ public: BasicBlock::iterator *LoopBody); private: - /// @brief The IR builder we use to create instructions. + /// The IR builder we use to create instructions. PollyIRBuilder &Builder; - /// @brief A pass pointer to update analysis information. + /// A pass pointer to update analysis information. Pass *P; - /// @brief The loop info of the current function we need to update. + /// The loop info of the current function we need to update. LoopInfo &LI; - /// @brief The dominance tree of the current function we need to update. + /// The dominance tree of the current function we need to update. DominatorTree &DT; - /// @brief The target layout to get the right size for types. + /// The target layout to get the right size for types. const DataLayout &DL; - /// @brief The type of a "long" on this hardware used for backend calls. + /// The type of a "long" on this hardware used for backend calls. Type *LongType; - /// @brief The current module + /// The current module Module *M; public: @@ -154,7 +154,7 @@ public: /// specific OpenMP parallel loop, but generate individual parts of it /// (e.g., the subfunction definition). - /// @brief Create a runtime library call to spawn the worker threads. + /// Create a runtime library call to spawn the worker threads. /// /// @param SubFn The subfunction which holds the loop body. /// @param SubFnParam The parameter for the subfunction (basically the struct @@ -165,10 +165,10 @@ public: void createCallSpawnThreads(Value *SubFn, Value *SubFnParam, Value *LB, Value *UB, Value *Stride); - /// @brief Create a runtime library call to join the worker threads. + /// Create a runtime library call to join the worker threads. void createCallJoinThreads(); - /// @brief Create a runtime library call to get the next work item. + /// Create a runtime library call to get the next work item. /// /// @param LBPtr A pointer value to store the work item begin in. /// @param UBPtr A pointer value to store the work item end in. @@ -176,20 +176,20 @@ public: /// @returns A true value if the work item is not empty. Value *createCallGetWorkItem(Value *LBPtr, Value *UBPtr); - /// @brief Create a runtime library call to allow cleanup of the thread. + /// Create a runtime library call to allow cleanup of the thread. /// /// @note This function is called right before the thread will exit the /// subfunction and only if the runtime system depends depends on it. void createCallCleanupThread(); - /// @brief Create a struct for all @p Values and store them in there. + /// Create a struct for all @p Values and store them in there. /// /// @param Values The values which should be stored in the struct. /// /// @return The created struct. AllocaInst *storeValuesIntoStruct(SetVector<Value *> &Values); - /// @brief Extract all values from the @p Struct and construct the mapping. + /// Extract all values from the @p Struct and construct the mapping. /// /// @param Values The values which were stored in the struct. /// @param Struct The struct holding all the values in @p Values. @@ -198,10 +198,10 @@ public: void extractValuesFromStruct(SetVector<Value *> Values, Type *Ty, Value *Struct, ValueMapT &VMap); - /// @brief Create the definition of the parallel subfunction. + /// Create the definition of the parallel subfunction. Function *createSubFnDefinition(); - /// @brief Create the parallel subfunction. + /// Create the parallel subfunction. /// /// @param Stride The induction variable increment. /// @param Struct A struct holding all values in @p Values. diff --git a/polly/include/polly/CodeGen/RuntimeDebugBuilder.h b/polly/include/polly/CodeGen/RuntimeDebugBuilder.h index 7dd0453811c..b7b5698c5bb 100644 --- a/polly/include/polly/CodeGen/RuntimeDebugBuilder.h +++ b/polly/include/polly/CodeGen/RuntimeDebugBuilder.h @@ -24,13 +24,13 @@ class Function; namespace polly { -/// @brief Insert function calls that print certain LLVM values at run time. +/// Insert function calls that print certain LLVM values at run time. /// /// This class inserts libc function calls to print certain LLVM values at /// run time. struct RuntimeDebugBuilder { - /// @brief Print a set of LLVM-IR Values or StringRefs via printf + /// Print a set of LLVM-IR Values or StringRefs via printf /// /// This function emits a call to printf that will print the given arguments. /// It is useful for debugging CPU programs. All arguments given in this list @@ -46,7 +46,7 @@ struct RuntimeDebugBuilder { createPrinter(Builder, /* CPU */ false, Vector, args...); } - /// @brief Print a set of LLVM-IR Values or StringRefs on an NVIDIA GPU. + /// Print a set of LLVM-IR Values or StringRefs on an NVIDIA GPU. /// /// This function emits a call to vprintf that will print the given /// arguments from within a kernel thread. It is useful for debugging @@ -64,7 +64,7 @@ struct RuntimeDebugBuilder { } private: - /// @brief Handle Values. + /// Handle Values. template <typename... Args> static void createPrinter(PollyIRBuilder &Builder, bool UseGPU, std::vector<llvm::Value *> &Values, @@ -73,7 +73,7 @@ private: createPrinter(Builder, UseGPU, Values, args...); } - /// @brief Handle StringRefs. + /// Handle StringRefs. template <typename... Args> static void createPrinter(PollyIRBuilder &Builder, bool UseGPU, std::vector<llvm::Value *> &Values, @@ -82,7 +82,7 @@ private: createPrinter(Builder, UseGPU, Values, args...); } - /// @brief Handle ArrayRefs. + /// Handle ArrayRefs. template <typename... Args> static void createPrinter(PollyIRBuilder &Builder, bool UseGPU, std::vector<llvm::Value *> &Values, @@ -97,25 +97,25 @@ private: createPrinter(Builder, UseGPU, Values, args...); } - /// @brief Print a list of Values. + /// Print a list of Values. static void createPrinter(PollyIRBuilder &Builder, bool UseGPU, llvm::ArrayRef<llvm::Value *> Values); - /// @brief Print a list of Values on a GPU. + /// Print a list of Values on a GPU. static void createGPUPrinterT(PollyIRBuilder &Builder, llvm::ArrayRef<llvm::Value *> Values); - /// @brief Print a list of Values on a CPU. + /// Print a list of Values on a CPU. static void createCPUPrinterT(PollyIRBuilder &Builder, llvm::ArrayRef<llvm::Value *> Values); - /// @brief Get a reference to the 'printf' function. + /// Get a reference to the 'printf' function. /// /// If the current module does not yet contain a reference to printf, we /// insert a reference to it. Otherwise the existing reference is returned. static llvm::Function *getPrintF(PollyIRBuilder &Builder); - /// @brief Call printf + /// Call printf /// /// @param Builder The builder used to insert the code. /// @param Format The format string. @@ -123,21 +123,21 @@ private: static void createPrintF(PollyIRBuilder &Builder, std::string Format, llvm::ArrayRef<llvm::Value *> Values); - /// @brief Get (and possibly insert) a vprintf declaration into the module. + /// Get (and possibly insert) a vprintf declaration into the module. static llvm::Function *getVPrintF(PollyIRBuilder &Builder); - /// @brief Call fflush + /// Call fflush /// /// @parma Builder The builder used to insert the code. static void createFlush(PollyIRBuilder &Builder); - /// @brief Get (and possibly insert) a NVIDIA address space cast call. + /// Get (and possibly insert) a NVIDIA address space cast call. static llvm::Function *getAddressSpaceCast(PollyIRBuilder &Builder, unsigned Src, unsigned Dst, unsigned SrcBits = 8, unsigned DstBits = 8); - /// @brief Get identifiers that describe the currently executed GPU thread. + /// Get identifiers that describe the currently executed GPU thread. /// /// The result will be a vector that if passed to the GPU printer will result /// into a string (initialized to values corresponding to the printing diff --git a/polly/include/polly/CodeGen/Utils.h b/polly/include/polly/CodeGen/Utils.h index b8db254651c..3be2cfcaacb 100644 --- a/polly/include/polly/CodeGen/Utils.h +++ b/polly/include/polly/CodeGen/Utils.h @@ -23,7 +23,7 @@ namespace polly { class Scop; -/// @brief Execute a Scop conditionally wrt @p RTC. +/// Execute a Scop conditionally wrt @p RTC. /// /// In the CFG the optimized code of the Scop is generated next to the /// original code. Both the new and the original version of the code remain diff --git a/polly/include/polly/DependenceInfo.h b/polly/include/polly/DependenceInfo.h index aced9b0065a..b43fd60a988 100644 --- a/polly/include/polly/DependenceInfo.h +++ b/polly/include/polly/DependenceInfo.h @@ -41,7 +41,7 @@ class Scop; class ScopStmt; class MemoryAccess; -/// @brief The accumulated dependence information for a SCoP. +/// The accumulated dependence information for a SCoP. /// /// The Dependences struct holds all dependence information we collect and /// compute for one SCoP. It also offers an interface that allows users to @@ -58,13 +58,13 @@ struct Dependences { NumAnalysisLevels }; - /// @brief Map type for reduction dependences. + /// Map type for reduction dependences. using ReductionDependencesMapTy = DenseMap<MemoryAccess *, isl_map *>; - /// @brief Map type to associate statements with schedules. + /// Map type to associate statements with schedules. using StatementToIslMapTy = DenseMap<ScopStmt *, isl_map *>; - /// @brief The type of the dependences. + /// The type of the dependences. /// /// Reduction dependences are separated from RAW/WAW/WAR dependences because /// we can ignore them during the scheduling. That's because the order @@ -92,27 +92,27 @@ struct Dependences { TYPE_TC_RED = 1 << 4, }; - /// @brief Get the dependences of type @p Kinds. + /// Get the dependences of type @p Kinds. /// /// @param Kinds This integer defines the different kinds of dependences /// that will be returned. To return more than one kind, the /// different kinds are 'ored' together. __isl_give isl_union_map *getDependences(int Kinds) const; - /// @brief Report if valid dependences are available. + /// Report if valid dependences are available. bool hasValidDependences() const; - /// @brief Return the reduction dependences caused by @p MA. + /// Return the reduction dependences caused by @p MA. /// /// @return The reduction dependences caused by @p MA or nullptr if none. __isl_give isl_map *getReductionDependences(MemoryAccess *MA) const; - /// @brief Return all reduction dependences. + /// Return all reduction dependences. const ReductionDependencesMapTy &getReductionDependences() const { return ReductionDependences; } - /// @brief Check if a partial schedule is parallel wrt to @p Deps. + /// Check if a partial schedule is parallel wrt to @p Deps. /// /// @param Schedule The subset of the schedule space that we want to /// check. @@ -126,7 +126,7 @@ struct Dependences { __isl_take isl_union_map *Deps, __isl_give isl_pw_aff **MinDistancePtr = nullptr) const; - /// @brief Check if a new schedule is valid. + /// Check if a new schedule is valid. /// /// @param S The current SCoP. /// @param NewSchedules The new schedules @@ -135,64 +135,64 @@ struct Dependences { /// dependences. bool isValidSchedule(Scop &S, StatementToIslMapTy *NewSchedules) const; - /// @brief Print the stored dependence information. + /// Print the stored dependence information. void print(llvm::raw_ostream &OS) const; - /// @brief Dump the dependence information stored to the dbgs stream. + /// Dump the dependence information stored to the dbgs stream. void dump() const; - /// @brief Return the granularity of this dependence analysis. + /// Return the granularity of this dependence analysis. AnalyisLevel getDependenceLevel() { return Level; } - /// @brief Allow the DependenceInfo access to private members and methods. + /// Allow the DependenceInfo access to private members and methods. /// /// To restrict access to the internal state, only the DependenceInfo class /// is able to call or modify a Dependences struct. friend class DependenceInfo; friend class DependenceInfoWrapperPass; - /// @brief Destructor that will free internal objects. + /// Destructor that will free internal objects. ~Dependences() { releaseMemory(); } private: - /// @brief Create an empty dependences struct. + /// Create an empty dependences struct. explicit Dependences(const std::shared_ptr<isl_ctx> &IslCtx, AnalyisLevel Level) : RAW(nullptr), WAR(nullptr), WAW(nullptr), RED(nullptr), TC_RED(nullptr), IslCtx(IslCtx), Level(Level) {} - /// @brief Calculate and add at the privatization dependences. + /// Calculate and add at the privatization dependences. void addPrivatizationDependences(); - /// @brief Calculate the dependences for a certain SCoP @p S. + /// Calculate the dependences for a certain SCoP @p S. void calculateDependences(Scop &S); - /// @brief Set the reduction dependences for @p MA to @p Deps. + /// Set the reduction dependences for @p MA to @p Deps. void setReductionDependences(MemoryAccess *MA, __isl_take isl_map *Deps); - /// @brief Free the objects associated with this Dependences struct. + /// Free the objects associated with this Dependences struct. /// /// The Dependences struct will again be "empty" afterwards. void releaseMemory(); - /// @brief The different basic kinds of dependences we calculate. + /// The different basic kinds of dependences we calculate. isl_union_map *RAW; isl_union_map *WAR; isl_union_map *WAW; - /// @brief The special reduction dependences. + /// The special reduction dependences. isl_union_map *RED; - /// @brief The (reverse) transitive closure of reduction dependences. + /// The (reverse) transitive closure of reduction dependences. isl_union_map *TC_RED; - /// @brief Mapping from memory accesses to their reduction dependences. + /// Mapping from memory accesses to their reduction dependences. ReductionDependencesMapTy ReductionDependences; - /// @brief Isl context from the SCoP. + /// Isl context from the SCoP. std::shared_ptr<isl_ctx> IslCtx; - /// @brief Granularity of this dependence analysis + /// Granularity of this dependence analysis. const AnalyisLevel Level; }; @@ -200,10 +200,10 @@ class DependenceInfo : public ScopPass { public: static char ID; - /// @brief Construct a new DependenceInfo pass. + /// Construct a new DependenceInfo pass. DependenceInfo() : ScopPass(ID) {} - /// @brief Return the dependence information for the current SCoP. + /// Return the dependence information for the current SCoP. /// /// @param Level The granularity of dependence analysis result. /// @@ -211,40 +211,40 @@ public: /// const Dependences &getDependences(Dependences::AnalyisLevel Level); - /// @brief Recompute dependences from schedule and memory accesses. + /// Recompute dependences from schedule and memory accesses. const Dependences &recomputeDependences(Dependences::AnalyisLevel Level); - /// @brief Compute the dependence information for the SCoP @p S. + /// Compute the dependence information for the SCoP @p S. bool runOnScop(Scop &S) override; - /// @brief Print the dependences for the given SCoP to @p OS. + /// Print the dependences for the given SCoP to @p OS. void printScop(raw_ostream &OS, Scop &) const override; - /// @brief Release the internal memory. + /// Release the internal memory. void releaseMemory() override { for (auto &d : D) d.reset(); } - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; private: Scop *S; - /// @brief Dependences struct for the current SCoP. + /// Dependences struct for the current SCoP. std::unique_ptr<Dependences> D[Dependences::NumAnalysisLevels]; }; -/// @brief Construct a new DependenceInfoWrapper pass. +/// Construct a new DependenceInfoWrapper pass. class DependenceInfoWrapperPass : public FunctionPass { public: static char ID; - /// @brief Construct a new DependenceInfoWrapper pass. + /// Construct a new DependenceInfoWrapper pass. DependenceInfoWrapperPass() : FunctionPass(ID) {} - /// @brief Return the dependence information for the given SCoP. + /// Return the dependence information for the given SCoP. /// /// @param S SCoP object. /// @param Level The granularity of dependence analysis result. @@ -253,26 +253,26 @@ public: /// const Dependences &getDependences(Scop *S, Dependences::AnalyisLevel Level); - /// @brief Recompute dependences from schedule and memory accesses. + /// Recompute dependences from schedule and memory accesses. const Dependences &recomputeDependences(Scop *S, Dependences::AnalyisLevel Level); - /// @brief Compute the dependence information on-the-fly for the function. + /// Compute the dependence information on-the-fly for the function. bool runOnFunction(Function &F) override; - /// @brief Print the dependences for the current function to @p OS. + /// Print the dependences for the current function to @p OS. void print(raw_ostream &OS, const Module *M = nullptr) const override; - /// @brief Release the internal memory. + /// Release the internal memory. void releaseMemory() override { ScopToDepsMap.clear(); } - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; private: using ScopToDepsMapTy = DenseMap<Scop *, std::unique_ptr<Dependences>>; - /// @brief Scop to Dependence map for the current function. + /// Scop to Dependence map for the current function. ScopToDepsMapTy ScopToDepsMap; }; diff --git a/polly/include/polly/PolyhedralInfo.h b/polly/include/polly/PolyhedralInfo.h index 3f2d6a39a66..332a94b1d5d 100644 --- a/polly/include/polly/PolyhedralInfo.h +++ b/polly/include/polly/PolyhedralInfo.h @@ -34,18 +34,18 @@ class PolyhedralInfo : public llvm::FunctionPass { public: static char ID; // Pass identification, replacement for typeid - /// @brief Construct a new PolyhedralInfo pass. + /// Construct a new PolyhedralInfo pass. PolyhedralInfo() : FunctionPass(ID) {} ~PolyhedralInfo() {} - /// @brief Check if a given loop is parallel. + /// Check if a given loop is parallel. /// /// @param L The loop. /// /// @return Returns true, if loop is parallel false otherwise. bool isParallel(llvm::Loop *L) const; - /// @brief Return the SCoP containing the @p L loop. + /// Return the SCoP containing the @p L loop. /// /// @param L The loop. /// @@ -53,7 +53,7 @@ public: /// Returns null if the loop is not contained in any SCoP. const Scop *getScopContainingLoop(llvm::Loop *L) const; - /// @brief Computes the partial schedule for the given @p L loop. + /// Computes the partial schedule for the given @p L loop. /// /// @param S The SCoP containing the given loop /// @param L The loop. @@ -62,21 +62,21 @@ public: __isl_give isl_union_map *getScheduleForLoop(const Scop *S, llvm::Loop *L) const; - /// @brief Get the SCoP and dependence analysis information for @p F. + /// Get the SCoP and dependence analysis information for @p F. bool runOnFunction(llvm::Function &F) override; - /// @brief Release the internal memory. + /// Release the internal memory. void releaseMemory() override {} - /// @brief Print to @p OS if each dimension of a loop nest is parallel or not. + /// Print to @p OS if each dimension of a loop nest is parallel or not. void print(llvm::raw_ostream &OS, const llvm::Module *M = nullptr) const override; - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(llvm::AnalysisUsage &AU) const override; private: - /// @brief Check if a given loop is parallel or vectorizable. + /// Check if a given loop is parallel or vectorizable. /// /// @param L The loop. /// @param MinDepDistPtr If not nullptr, the minimal dependence distance will diff --git a/polly/include/polly/ScheduleOptimizer.h b/polly/include/polly/ScheduleOptimizer.h index 44be5521a18..ece240b6270 100644 --- a/polly/include/polly/ScheduleOptimizer.h +++ b/polly/include/polly/ScheduleOptimizer.h @@ -20,7 +20,7 @@ struct isl_schedule; struct isl_schedule_node; struct isl_union_map; -/// @brief Parameters of the micro kernel. +/// Parameters of the micro kernel. /// /// Parameters, which determine sizes of rank-1 (i.e., outer product) update /// used in the optimized matrix multiplication. @@ -30,7 +30,7 @@ struct MicroKernelParamsTy { int Nr; }; -/// @brief Parameters of the macro kernel. +/// Parameters of the macro kernel. /// /// Parameters, which determine sizes of blocks of partitioned matrices /// used in the optimized matrix multiplication. @@ -48,7 +48,7 @@ class Scop; class ScheduleTreeOptimizer { public: - /// @brief Apply schedule tree transformations. + /// Apply schedule tree transformations. /// /// This function takes an (possibly already optimized) schedule tree and /// applies a set of additional optimizations on the schedule tree. The @@ -65,7 +65,7 @@ public: optimizeSchedule(__isl_take isl_schedule *Schedule, const llvm::TargetTransformInfo *TTI = nullptr); - /// @brief Apply schedule tree transformations. + /// Apply schedule tree transformations. /// /// This function takes a node in an (possibly already optimized) schedule /// tree and applies a set of additional optimizations on this schedule tree @@ -81,7 +81,7 @@ public: optimizeScheduleNode(__isl_take isl_schedule_node *Node, const llvm::TargetTransformInfo *TTI = nullptr); - /// @brief Decide if the @p NewSchedule is profitable for @p S. + /// Decide if the @p NewSchedule is profitable for @p S. /// /// @param S The SCoP we optimize. /// @param NewSchedule The new schedule we computed. @@ -90,7 +90,7 @@ public: static bool isProfitableSchedule(polly::Scop &S, __isl_keep isl_union_map *NewSchedule); - /// @brief Isolate a set of partial tile prefixes. + /// Isolate a set of partial tile prefixes. /// /// This set should ensure that it contains only partial tile prefixes that /// have exactly VectorWidth iterations. @@ -102,7 +102,7 @@ public: isolateFullPartialTiles(__isl_take isl_schedule_node *Node, int VectorWidth); private: - /// @brief Tile a schedule node. + /// Tile a schedule node. /// /// @param Node The node to tile. /// @param Identifier An name that identifies this kind of tiling and @@ -116,7 +116,7 @@ private: tileNode(__isl_take isl_schedule_node *Node, const char *Identifier, llvm::ArrayRef<int> TileSizes, int DefaultTileSize); - /// @brief Tile a schedule node and unroll point loops. + /// Tile a schedule node and unroll point loops. /// /// @param Node The node to register tile. /// @param TileSizes A vector of tile sizes that should be used for @@ -126,7 +126,7 @@ private: applyRegisterTiling(__isl_take isl_schedule_node *Node, llvm::ArrayRef<int> TileSizes, int DefaultTileSize); - /// @brief Apply the BLIS matmul optimization pattern. + /// Apply the BLIS matmul optimization pattern. /// /// Apply the BLIS matmul optimization pattern. BLIS implements gemm as three /// nested loops around a macro-kernel, plus two packing routines. @@ -158,7 +158,7 @@ private: optimizeMatMulPattern(__isl_take isl_schedule_node *Node, const llvm::TargetTransformInfo *TTI); - /// @brief Check if this node is a band node we want to tile. + /// Check if this node is a band node we want to tile. /// /// We look for innermost band nodes where individual dimensions are marked as /// permutable. @@ -166,7 +166,7 @@ private: /// @param Node The node to check. static bool isTileableBandNode(__isl_keep isl_schedule_node *Node); - /// @brief Pre-vectorizes one scheduling dimension of a schedule band. + /// Pre-vectorizes one scheduling dimension of a schedule band. /// /// prevectSchedBand splits out the dimension DimToVectorize, tiles it and /// sinks the resulting point loop. @@ -201,7 +201,7 @@ private: prevectSchedBand(__isl_take isl_schedule_node *Node, unsigned DimToVectorize, int VectorWidth); - /// @brief Apply additional optimizations on the bands in the schedule tree. + /// Apply additional optimizations on the bands in the schedule tree. /// /// We are looking for an innermost band node and apply the following /// transformations: @@ -219,7 +219,7 @@ private: /// (currently unused). static isl_schedule_node *optimizeBand(isl_schedule_node *Node, void *User); - /// @brief Apply additional optimizations on the bands in the schedule tree. + /// Apply additional optimizations on the bands in the schedule tree. /// /// We apply the following /// transformations: @@ -235,7 +235,7 @@ private: static isl_schedule_node *standardBandOpts(__isl_take isl_schedule_node *Node, void *User); - /// @brief Check if this node contains a partial schedule that could + /// Check if this node contains a partial schedule that could /// probably be optimized with analytical modeling. /// /// isMatrMultPattern tries to determine whether the following conditions @@ -255,7 +255,7 @@ private: /// @param Node The node to check. static bool isMatrMultPattern(__isl_keep isl_schedule_node *Node); - /// @brief Create the BLIS macro-kernel. + /// Create the BLIS macro-kernel. /// /// We create the BLIS macro-kernel by applying a combination of tiling /// of dimensions of the band node and interchanging of two innermost @@ -269,7 +269,7 @@ private: createMacroKernel(__isl_take isl_schedule_node *Node, MacroKernelParamsTy MacroKernelParams); - /// @brief Create the BLIS macro-kernel. + /// Create the BLIS macro-kernel. /// /// We create the BLIS macro-kernel by applying a combination of tiling /// of dimensions of the band node and interchanging of two innermost diff --git a/polly/include/polly/ScopBuilder.h b/polly/include/polly/ScopBuilder.h index bd776ced5ff..203ff861f41 100644 --- a/polly/include/polly/ScopBuilder.h +++ b/polly/include/polly/ScopBuilder.h @@ -21,34 +21,34 @@ namespace polly { -/// @brief Build the Polly IR (Scop and ScopStmt) on a Region. +/// Build the Polly IR (Scop and ScopStmt) on a Region. class ScopBuilder { //===-------------------------------------------------------------------===// ScopBuilder(const ScopBuilder &) = delete; const ScopBuilder &operator=(const ScopBuilder &) = delete; - /// @brief The AliasAnalysis to build AliasSetTracker. + /// The AliasAnalysis to build AliasSetTracker. AliasAnalysis &AA; - /// @brief Target data for element size computing. + /// Target data for element size computing. const DataLayout &DL; - /// @brief DominatorTree to reason about guaranteed execution. + /// DominatorTree to reason about guaranteed execution. DominatorTree &DT; - /// @brief LoopInfo for information about loops + /// LoopInfo for information about loops. LoopInfo &LI; - /// @biref Valid Regions for Scop + /// Valid Regions for Scop ScopDetection &SD; - /// @brief The ScalarEvolution to help building Scop. + /// The ScalarEvolution to help building Scop. ScalarEvolution &SE; - /// @brief Set of instructions that might read any memory location. + /// Set of instructions that might read any memory location. SmallVector<Instruction *, 16> GlobalReads; - /// @brief Set of all accessed array base pointers. + /// Set of all accessed array base pointers. SmallSetVector<Value *, 16> ArrayBasePointers; // The Scop @@ -57,8 +57,8 @@ class ScopBuilder { // Build the SCoP for Region @p R. void buildScop(Region &R, AssumptionCache &AC); - /// @brief Try to build a multi-dimensional fixed sized MemoryAccess from - /// the Load/Store instruction. + /// Try to build a multi-dimensional fixed sized MemoryAccess from the + /// Load/Store instruction. /// /// @param Inst The Load/Store instruction that access the memory /// @param L The parent loop of the instruction @@ -66,7 +66,7 @@ class ScopBuilder { /// @returns True if the access could be built, False otherwise. bool buildAccessMultiDimFixed(MemAccInst Inst, Loop *L); - /// @brief Try to build a multi-dimensional parameteric sized MemoryAccess + /// Try to build a multi-dimensional parameteric sized MemoryAccess. /// from the Load/Store instruction. /// /// @param Inst The Load/Store instruction that access the memory @@ -75,7 +75,7 @@ class ScopBuilder { /// @returns True if the access could be built, False otherwise. bool buildAccessMultiDimParam(MemAccInst Inst, Loop *L); - /// @brief Try to build a MemoryAccess for a memory intrinsic. + /// Try to build a MemoryAccess for a memory intrinsic. /// /// @param Inst The instruction that access the memory /// @param L The parent loop of the instruction @@ -83,7 +83,7 @@ class ScopBuilder { /// @returns True if the access could be built, False otherwise. bool buildAccessMemIntrinsic(MemAccInst Inst, Loop *L); - /// @brief Try to build a MemoryAccess for a call instruction. + /// Try to build a MemoryAccess for a call instruction. /// /// @param Inst The call instruction that access the memory /// @param L The parent loop of the instruction @@ -91,33 +91,35 @@ class ScopBuilder { /// @returns True if the access could be built, False otherwise. bool buildAccessCallInst(MemAccInst Inst, Loop *L); - /// @brief Build a single-dimensional parametric sized MemoryAccess + /// Build a single-dimensional parametric sized MemoryAccess /// from the Load/Store instruction. /// /// @param Inst The Load/Store instruction that access the memory /// @param L The parent loop of the instruction void buildAccessSingleDim(MemAccInst Inst, Loop *L); - /// @brief Build an instance of MemoryAccess from the Load/Store instruction. + /// Build an instance of MemoryAccess from the Load/Store instruction. /// /// @param Inst The Load/Store instruction that access the memory /// @param L The parent loop of the instruction void buildMemoryAccess(MemAccInst Inst, Loop *L); - /// @brief Analyze and extract the cross-BB scalar dependences (or, - /// dataflow dependencies) of an instruction. + /// Analyze and extract the cross-BB scalar dependences (or, dataflow + /// dependencies) of an instruction. /// /// @param Inst The instruction to be analyzed. void buildScalarDependences(Instruction *Inst); - /// @brief Search for uses of the llvm::Value defined by @p Inst that are not - /// within the SCoP. If there is such use, add a SCALAR WRITE such that - /// it is available after the SCoP as escaping value. + /// Build the escaping dependences for @p Inst. + /// + /// Search for uses of the llvm::Value defined by @p Inst that are not + /// within the SCoP. If there is such use, add a SCALAR WRITE such that + /// it is available after the SCoP as escaping value. /// /// @param Inst The instruction to be analyzed. void buildEscapingDependences(Instruction *Inst); - /// @brief Create MemoryAccesses for the given PHI node in the given region. + /// Create MemoryAccesses for the given PHI node in the given region. /// /// @param PHI The PHI node to be handled /// @param NonAffineSubRegion The non affine sub-region @p PHI is in. @@ -125,13 +127,13 @@ class ScopBuilder { void buildPHIAccesses(PHINode *PHI, Region *NonAffineSubRegion, bool IsExitBlock = false); - /// @brief Build the access functions for the subregion @p SR. + /// Build the access functions for the subregion @p SR. /// /// @param SR A subregion of @p R. /// @param InsnToMemAcc The Instruction to MemoryAccess mapping. void buildAccessFunctions(Region &SR); - /// @brief Create ScopStmt for all BBs and non-affine subregions of @p SR. + /// Create ScopStmt for all BBs and non-affine subregions of @p SR. /// /// @param SR A subregion of @p R. /// @@ -139,7 +141,7 @@ class ScopBuilder { /// access any memory and thus have no effect. void buildStmts(Region &SR); - /// @brief Build the access functions for the basic block @p BB + /// Build the access functions for the basic block @p BB. /// /// @param BB A basic block in @p R. /// @param NonAffineSubRegion The non affine sub-region @p BB is in. @@ -148,7 +150,7 @@ class ScopBuilder { Region *NonAffineSubRegion = nullptr, bool IsExitBlock = false); - /// @brief Create a new MemoryAccess object and add it to #AccFuncMap. + /// Create a new MemoryAccess object and add it to #AccFuncMap. /// /// @param BB The block where the access takes place. /// @param Inst The instruction doing the access. It is not necessarily @@ -172,7 +174,7 @@ class ScopBuilder { ArrayRef<const SCEV *> Sizes, ScopArrayInfo::MemoryKind Kind); - /// @brief Create a MemoryAccess that represents either a LoadInst or + /// Create a MemoryAccess that represents either a LoadInst or /// StoreInst. /// /// @param MemAccInst The LoadInst or StoreInst. @@ -190,7 +192,7 @@ class ScopBuilder { ArrayRef<const SCEV *> Subscripts, ArrayRef<const SCEV *> Sizes, Value *AccessValue); - /// @brief Create a MemoryAccess for writing an llvm::Instruction. + /// Create a MemoryAccess for writing an llvm::Instruction. /// /// The access will be created at the position of @p Inst. /// @@ -200,8 +202,8 @@ class ScopBuilder { /// @see ScopArrayInfo::MemoryKind void ensureValueWrite(Instruction *Inst); - /// @brief Ensure an llvm::Value is available in the BB's statement, creating - /// a MemoryAccess for reloading it if necessary. + /// Ensure an llvm::Value is available in the BB's statement, creating a + /// MemoryAccess for reloading it if necessary. /// /// @param V The value expected to be loaded. /// @param UserBB Where to reload the value. @@ -210,7 +212,7 @@ class ScopBuilder { /// @see ScopArrayInfo::MemoryKind void ensureValueRead(Value *V, BasicBlock *UserBB); - /// @brief Create a write MemoryAccess for the incoming block of a phi node. + /// Create a write MemoryAccess for the incoming block of a phi node. /// /// Each of the incoming blocks write their incoming value to be picked in the /// phi's block. @@ -226,7 +228,7 @@ class ScopBuilder { void ensurePHIWrite(PHINode *PHI, BasicBlock *IncomingBlock, Value *IncomingValue, bool IsExitBlock); - /// @brief Create a MemoryAccess for reading the value of a phi. + /// Create a MemoryAccess for reading the value of a phi. /// /// The modeling assumes that all incoming blocks write their incoming value /// to the same location. Thus, this access will read the incoming block's @@ -245,8 +247,8 @@ public: ScopDetection &SD, ScalarEvolution &SE); ~ScopBuilder() {} - /// @brief Try to build the Polly IR of static control part on the current - /// SESE-Region. + /// Try to build the Polly IR of static control part on the current + /// SESE-Region. /// /// @return Give up the ownership of the scop object or static control part /// for the region diff --git a/polly/include/polly/ScopDetection.h b/polly/include/polly/ScopDetection.h index 75aaf30bcad..c55017e5f15 100644 --- a/polly/include/polly/ScopDetection.h +++ b/polly/include/polly/ScopDetection.h @@ -112,11 +112,11 @@ extern bool PollyUseRuntimeAliasChecks; extern bool PollyProcessUnprofitable; extern bool PollyInvariantLoadHoisting; -/// @brief A function attribute which will cause Polly to skip the function +/// A function attribute which will cause Polly to skip the function extern llvm::StringRef PollySkipFnAttr; //===----------------------------------------------------------------------===// -/// @brief Pass to detect the maximal static control parts (Scops) of a +/// Pass to detect the maximal static control parts (Scops) of a /// function. class ScopDetection : public FunctionPass { public: @@ -125,56 +125,56 @@ public: // Remember the valid regions RegionSet ValidRegions; - /// @brief Context variables for SCoP detection. + /// Context variables for SCoP detection. struct DetectionContext { Region &CurRegion; // The region to check. AliasSetTracker AST; // The AliasSetTracker to hold the alias information. bool Verifying; // If we are in the verification phase? - /// @brief Container to remember rejection reasons for this region. + /// Container to remember rejection reasons for this region. RejectLog Log; - /// @brief Map a base pointer to all access functions accessing it. + /// Map a base pointer to all access functions accessing it. /// /// This map is indexed by the base pointer. Each element of the map /// is a list of memory accesses that reference this base pointer. BaseToAFs Accesses; - /// @brief The set of base pointers with non-affine accesses. + /// The set of base pointers with non-affine accesses. /// /// This set contains all base pointers and the locations where they are /// used for memory accesses that can not be detected as affine accesses. SetVector<std::pair<const SCEVUnknown *, Loop *>> NonAffineAccesses; BaseToElSize ElementSize; - /// @brief The region has at least one load instruction. + /// The region has at least one load instruction. bool hasLoads; - /// @brief The region has at least one store instruction. + /// The region has at least one store instruction. bool hasStores; - /// @brief Flag to indicate the region has at least one unknown access. + /// Flag to indicate the region has at least one unknown access. bool HasUnknownAccess; - /// @brief The set of non-affine subregions in the region we analyze. + /// The set of non-affine subregions in the region we analyze. RegionSet NonAffineSubRegionSet; - /// @brief The set of loops contained in non-affine regions. + /// The set of loops contained in non-affine regions. BoxedLoopsSetTy BoxedLoopsSet; - /// @brief Loads that need to be invariant during execution. + /// Loads that need to be invariant during execution. InvariantLoadsSetTy RequiredILS; - /// @brief Map to memory access description for the corresponding LLVM + /// Map to memory access description for the corresponding LLVM /// instructions. MapInsnToMemAcc InsnToMemAcc; - /// @brief Initialize a DetectionContext from scratch. + /// Initialize a DetectionContext from scratch. DetectionContext(Region &R, AliasAnalysis &AA, bool Verify) : CurRegion(R), AST(AA), Verifying(Verify), Log(&R), hasLoads(false), hasStores(false), HasUnknownAccess(false) {} - /// @brief Initialize a DetectionContext with the data from @p DC. + /// Initialize a DetectionContext with the data from @p DC. DetectionContext(const DetectionContext &&DC) : CurRegion(DC.CurRegion), AST(DC.AST.getAliasAnalysis()), Verifying(DC.Verifying), Log(std::move(DC.Log)), @@ -194,7 +194,7 @@ private: ScopDetection(const ScopDetection &) = delete; const ScopDetection &operator=(const ScopDetection &) = delete; - /// @brief Analysis passes used. + /// Analysis passes used. //@{ const DominatorTree *DT; ScalarEvolution *SE; @@ -203,19 +203,19 @@ private: AliasAnalysis *AA; //@} - /// @brief Map to remember detection contexts for all regions. + /// Map to remember detection contexts for all regions. using DetectionContextMapTy = DenseMap<BBPair, DetectionContext>; mutable DetectionContextMapTy DetectionContextMap; - /// @brief Remove cached results for @p R. + /// Remove cached results for @p R. void removeCachedResults(const Region &R); - /// @brief Remove cached results for the children of @p R recursively. + /// Remove cached results for the children of @p R recursively. /// /// @returns The number of regions erased regions. unsigned removeCachedResultsRecursively(const Region &R); - /// @brief Add the region @p AR as over approximated sub-region in @p Context. + /// Add the region @p AR as over approximated sub-region in @p Context. /// /// @param AR The non-affine subregion. /// @param Context The current detection context. @@ -223,7 +223,7 @@ private: /// @returns True if the subregion can be over approximated, false otherwise. bool addOverApproximatedRegion(Region *AR, DetectionContext &Context) const; - /// @brief Find for a given base pointer terms that hint towards dimension + /// Find for a given base pointer terms that hint towards dimension /// sizes of a multi-dimensional array. /// /// @param Context The current detection context. @@ -233,7 +233,7 @@ private: getDelinearizationTerms(DetectionContext &Context, const SCEVUnknown *BasePointer) const; - /// @brief Check if the dimension size of a delinearized array is valid. + /// Check if the dimension size of a delinearized array is valid. /// /// @param Context The current detection context. /// @param Sizes The sizes of the different array dimensions. @@ -245,7 +245,7 @@ private: SmallVectorImpl<const SCEV *> &Sizes, const SCEVUnknown *BasePointer, Loop *Scope) const; - /// @brief Derive access functions for a given base pointer. + /// Derive access functions for a given base pointer. /// /// @param Context The current detection context. /// @param Sizes The sizes of the different array dimensions. @@ -259,7 +259,7 @@ private: const SCEVUnknown *BasePointer, std::shared_ptr<ArrayShape> Shape) const; - /// @brief Check if all accesses to a given BasePointer are affine. + /// Check if all accesses to a given BasePointer are affine. /// /// @param Context The current detection context. /// @param basepointer the base pointer we are interested in. @@ -283,14 +283,14 @@ private: /// @param The region tree to scan for scops. void findScops(Region &R); - /// @brief Check if all basic block in the region are valid. + /// Check if all basic block in the region are valid. /// /// @param Context The context of scop detection. /// /// @return True if all blocks in R are valid, false otherwise. bool allBlocksValid(DetectionContext &Context) const; - /// @brief Check if a region has sufficient compute instructions + /// Check if a region has sufficient compute instructions. /// /// This function checks if a region has a non-trivial number of instructions /// in each loop. This can be used as an indicator if a loop is worth @@ -304,7 +304,7 @@ private: bool hasSufficientCompute(DetectionContext &Context, int NumAffineLoops) const; - /// @brief Check if the unique affine loop might be amendable to distribution. + /// Check if the unique affine loop might be amendable to distribution. /// /// This function checks if the number of non-trivial blocks in the unique /// affine loop in Context.CurRegion is at least two, thus if the loop might @@ -315,7 +315,7 @@ private: /// @return True only if the affine loop might be amendable to distributable. bool hasPossiblyDistributableLoop(DetectionContext &Context) const; - /// @brief Check if a region is profitable to optimize. + /// Check if a region is profitable to optimize. /// /// Regions that are unlikely to expose interesting optimization opportunities /// are called 'unprofitable' and may be skipped during scop detection. @@ -325,14 +325,14 @@ private: /// @return True if region is profitable to optimize, false otherwise. bool isProfitableRegion(DetectionContext &Context) const; - /// @brief Check if a region is a Scop. + /// Check if a region is a Scop. /// /// @param Context The context of scop detection. /// /// @return True if R is a Scop, false otherwise. bool isValidRegion(DetectionContext &Context) const; - /// @brief Check if an intrinsic call can be part of a Scop. + /// Check if an intrinsic call can be part of a Scop. /// /// @param II The intrinsic call instruction to check. /// @param Context The current detection context. @@ -340,7 +340,7 @@ private: /// @return True if the call instruction is valid, false otherwise. bool isValidIntrinsicInst(IntrinsicInst &II, DetectionContext &Context) const; - /// @brief Check if a call instruction can be part of a Scop. + /// Check if a call instruction can be part of a Scop. /// /// @param CI The call instruction to check. /// @param Context The current detection context. @@ -348,7 +348,7 @@ private: /// @return True if the call instruction is valid, false otherwise. bool isValidCallInst(CallInst &CI, DetectionContext &Context) const; - /// @brief Check if the given loads could be invariant and can be hoisted. + /// Check if the given loads could be invariant and can be hoisted. /// /// If true is returned the loads are added to the required invariant loads /// contained in the @p Context. @@ -360,7 +360,7 @@ private: bool onlyValidRequiredInvariantLoads(InvariantLoadsSetTy &RequiredILS, DetectionContext &Context) const; - /// @brief Check if a value is invariant in the region Reg. + /// Check if a value is invariant in the region Reg. /// /// @param Val Value to check for invariance. /// @param Reg The region to consider for the invariance of Val. @@ -369,7 +369,7 @@ private: /// identified by Reg. bool isInvariant(const Value &Val, const Region &Reg) const; - /// @brief Check if the memory access caused by @p Inst is valid. + /// Check if the memory access caused by @p Inst is valid. /// /// @param Inst The access instruction. /// @param AF The access function. @@ -378,7 +378,7 @@ private: bool isValidAccess(Instruction *Inst, const SCEV *AF, const SCEVUnknown *BP, DetectionContext &Context) const; - /// @brief Check if a memory access can be part of a Scop. + /// Check if a memory access can be part of a Scop. /// /// @param Inst The instruction accessing the memory. /// @param Context The context of scop detection. @@ -386,8 +386,8 @@ private: /// @return True if the memory access is valid, false otherwise. bool isValidMemoryAccess(MemAccInst Inst, DetectionContext &Context) const; - /// @brief Check if an instruction has any non trivial scalar dependencies - /// as part of a Scop. + /// Check if an instruction has any non trivial scalar dependencies as part of + /// a Scop. /// /// @param Inst The instruction to check. /// @param RefRegion The region in respect to which we check the access @@ -396,7 +396,7 @@ private: /// @return True if the instruction has scalar dependences, false otherwise. bool hasScalarDependency(Instruction &Inst, Region &RefRegion) const; - /// @brief Check if an instruction can be part of a Scop. + /// Check if an instruction can be part of a Scop. /// /// @param Inst The instruction to check. /// @param Context The context of scop detection. @@ -404,7 +404,7 @@ private: /// @return True if the instruction is valid, false otherwise. bool isValidInstruction(Instruction &Inst, DetectionContext &Context) const; - /// @brief Check if the switch @p SI with condition @p Condition is valid. + /// Check if the switch @p SI with condition @p Condition is valid. /// /// @param BB The block to check. /// @param SI The switch to check. @@ -416,7 +416,7 @@ private: bool isValidSwitch(BasicBlock &BB, SwitchInst *SI, Value *Condition, bool IsLoopBranch, DetectionContext &Context) const; - /// @brief Check if the branch @p BI with condition @p Condition is valid. + /// Check if the branch @p BI with condition @p Condition is valid. /// /// @param BB The block to check. /// @param BI The branch to check. @@ -428,7 +428,7 @@ private: bool isValidBranch(BasicBlock &BB, BranchInst *BI, Value *Condition, bool IsLoopBranch, DetectionContext &Context) const; - /// @brief Check if the SCEV @p S is affine in the current @p Context. + /// Check if the SCEV @p S is affine in the current @p Context. /// /// This will also use a heuristic to decide if we want to require loads to be /// invariant to make the expression affine or if we want to treat is as @@ -439,7 +439,7 @@ private: /// @param Context The context of scop detection. bool isAffine(const SCEV *S, Loop *Scope, DetectionContext &Context) const; - /// @brief Check if the control flow in a basic block is valid. + /// Check if the control flow in a basic block is valid. /// /// This function checks if a certain basic block is terminated by a /// Terminator instruction we can handle or, if this is not the case, @@ -456,7 +456,7 @@ private: bool isValidCFG(BasicBlock &BB, bool IsLoopBranch, bool AllowUnreachable, DetectionContext &Context) const; - /// @brief Is a loop valid with respect to a given region. + /// Is a loop valid with respect to a given region. /// /// @param L The loop to check. /// @param Context The context of scop detection. @@ -464,17 +464,17 @@ private: /// @return True if the loop is valid in the region. bool isValidLoop(Loop *L, DetectionContext &Context) const; - /// @brief Count the number of beneficial loops in @p R. + /// Count the number of beneficial loops in @p R. /// /// @param R The region to check int countBeneficialLoops(Region *R) const; - /// @brief Check if the function @p F is marked as invalid. + /// Check if the function @p F is marked as invalid. /// /// @note An OpenMP subfunction will be marked as invalid. bool isValidFunction(llvm::Function &F); - /// @brief Can ISL compute the trip count of a loop. + /// Can ISL compute the trip count of a loop. /// /// @param L The loop to check. /// @param Context The context of scop detection. @@ -482,10 +482,10 @@ private: /// @return True if ISL can compute the trip count of the loop. bool canUseISLTripCount(Loop *L, DetectionContext &Context) const; - /// @brief Print the locations of all detected scops. + /// Print the locations of all detected scops. void printLocations(llvm::Function &F); - /// @brief Check if a region is reducible or not. + /// Check if a region is reducible or not. /// /// @param Region The region to check. /// @param DbgLoc Parameter to save the location of instruction that @@ -494,7 +494,7 @@ private: /// @return True if R is reducible, false otherwise. bool isReducibleRegion(Region &R, DebugLoc &DbgLoc) const; - /// @brief Track diagnostics for invalid scops. + /// Track diagnostics for invalid scops. /// /// @param Context The context of scop detection. /// @param Assert Throw an assert in verify mode or not. @@ -507,15 +507,15 @@ public: static char ID; explicit ScopDetection(); - /// @brief Get the RegionInfo stored in this pass. + /// Get the RegionInfo stored in this pass. /// /// This was added to give the DOT printer easy access to this information. RegionInfo *getRI() const { return RI; } - /// @brief Get the LoopInfo stored in this pass. + /// Get the LoopInfo stored in this pass. LoopInfo *getLI() const { return LI; } - /// @brief Is the region is the maximum region of a Scop? + /// Is the region is the maximum region of a Scop? /// /// @param R The Region to test if it is maximum. /// @param Verify Rerun the scop detection to verify SCoP was not invalidated @@ -524,16 +524,16 @@ public: /// @return Return true if R is the maximum Region in a Scop, false otherwise. bool isMaxRegionInScop(const Region &R, bool Verify = true) const; - /// @brief Return the detection context for @p R, nullptr if @p R was invalid. + /// Return the detection context for @p R, nullptr if @p R was invalid. DetectionContext *getDetectionContext(const Region *R) const; - /// @brief Return the set of rejection causes for @p R. + /// Return the set of rejection causes for @p R. const RejectLog *lookupRejectionLog(const Region *R) const; - /// @brief Return true if @p SubR is a non-affine subregion in @p ScopR. + /// Return true if @p SubR is a non-affine subregion in @p ScopR. bool isNonAffineSubRegion(const Region *SubR, const Region *ScopR) const; - /// @brief Get a message why a region is invalid + /// Get a message why a region is invalid /// /// @param R The region for which we get the error message /// @@ -555,23 +555,22 @@ public: const_iterator end() const { return ValidRegions.end(); } //@} - /// @brief Emit rejection remarks for all rejected regions. + /// Emit rejection remarks for all rejected regions. /// /// @param F The function to emit remarks for. void emitMissedRemarks(const Function &F); - /// @brief Mark the function as invalid so we will not extract any scop from + /// Mark the function as invalid so we will not extract any scop from /// the function. /// /// @param F The function to mark as invalid. static void markFunctionAsInvalid(Function *F); - /// @brief Verify if all valid Regions in this Function are still valid + /// Verify if all valid Regions in this Function are still valid /// after some transformations. void verifyAnalysis() const; - /// @brief Verify if R is still a valid part of Scop after some - /// transformations. + /// Verify if R is still a valid part of Scop after some transformations. /// /// @param R The Region to verify. void verifyRegion(const Region &R) const; diff --git a/polly/include/polly/ScopDetectionDiagnostic.h b/polly/include/polly/ScopDetectionDiagnostic.h index 350522f24aa..2bdad7dc1ca 100644 --- a/polly/include/polly/ScopDetectionDiagnostic.h +++ b/polly/include/polly/ScopDetectionDiagnostic.h @@ -43,17 +43,17 @@ class Region; namespace polly { -/// @brief Type to hold region delimiters (entry & exit block). +/// Type to hold region delimiters (entry & exit block). using BBPair = std::pair<BasicBlock *, BasicBlock *>; -/// @brief Return the region delimiters (entry & exit block) of @p R. +/// Return the region delimiters (entry & exit block) of @p R. BBPair getBBPairForRegion(const Region *R); -/// @brief Set the begin and end source location for the region limited by @p P. +/// Set the begin and end source location for the region limited by @p P. void getDebugLocations(const BBPair &P, DebugLoc &Begin, DebugLoc &End); class RejectLog; -/// @brief Emit optimization remarks about the rejected regions to the user. +/// Emit optimization remarks about the rejected regions to the user. /// /// This emits the content of the reject log as optimization remarks. /// Remember to at least track failures (-polly-detect-track-failures). @@ -102,7 +102,7 @@ enum RejectReasonKind { }; //===----------------------------------------------------------------------===// -/// @brief Base class of all reject reasons found during Scop detection. +/// Base class of all reject reasons found during Scop detection. /// /// Subclasses of RejectReason should provide means to capture enough /// diagnostic information to help clients figure out what and where something @@ -122,12 +122,12 @@ public: virtual ~RejectReason() {} - /// @brief Generate a reasonable diagnostic message describing this error. + /// Generate a reasonable diagnostic message describing this error. /// /// @return A debug message representing this error. virtual std::string getMessage() const = 0; - /// @brief Generate a message for the end-user describing this error. + /// Generate a message for the end-user describing this error. /// /// The message provided has to be suitable for the end-user. So it should /// not reference any LLVM internal data structures or terminology. @@ -137,7 +137,7 @@ public: /// @return A short message representing this error. virtual std::string getEndUserMessage() const { return "Unspecified error."; } - /// @brief Get the source location of this error. + /// Get the source location of this error. /// /// @return The debug location for this error. virtual const llvm::DebugLoc &getDebugLoc() const; @@ -145,7 +145,7 @@ public: typedef std::shared_ptr<RejectReason> RejectReasonPtr; -/// @brief Stores all errors that ocurred during the detection. +/// Stores all errors that ocurred during the detection. class RejectLog { Region *R; llvm::SmallVector<RejectReasonPtr, 1> ErrorReports; @@ -159,7 +159,7 @@ public: iterator end() const { return ErrorReports.end(); } size_t size() const { return ErrorReports.size(); } - /// @brief Returns true, if we store at least one error. + /// Returns true, if we store at least one error. /// /// @return true, if we store at least one error. bool hasErrors() const { return size() > 0; } @@ -171,7 +171,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Base class for CFG related reject reasons. +/// Base class for CFG related reject reasons. /// /// Scop candidates that violate structural restrictions can be grouped under /// this reject reason class. @@ -187,7 +187,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures bad terminator within a Scop candidate. +/// Captures bad terminator within a Scop candidate. class ReportInvalidTerminator : public ReportCFG { BasicBlock *BB; @@ -208,7 +208,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures irreducible regions in CFG. +/// Captures irreducible regions in CFG. class ReportIrreducibleRegion : public ReportCFG { Region *R; DebugLoc DbgLoc; @@ -231,7 +231,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Base class for non-affine reject reasons. +/// Base class for non-affine reject reasons. /// /// Scop candidates that violate restrictions to affinity are reported under /// this class. @@ -258,7 +258,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures a condition that is based on an 'undef' value. +/// Captures a condition that is based on an 'undef' value. class ReportUndefCond : public ReportAffFunc { //===--------------------------------------------------------------------===// @@ -281,7 +281,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures an invalid condition +/// Captures an invalid condition /// /// Conditions have to be either constants or icmp instructions. class ReportInvalidCond : public ReportAffFunc { @@ -306,7 +306,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures an undefined operand. +/// Captures an undefined operand. class ReportUndefOperand : public ReportAffFunc { //===--------------------------------------------------------------------===// @@ -329,14 +329,14 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures a non-affine branch. +/// Captures a non-affine branch. class ReportNonAffBranch : public ReportAffFunc { //===--------------------------------------------------------------------===// // The BasicBlock we found the non-affine branch in. BasicBlock *BB; - /// @brief LHS & RHS of the failed condition. + /// LHS & RHS of the failed condition. //@{ const SCEV *LHS; const SCEV *RHS; @@ -362,7 +362,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures a missing base pointer. +/// Captures a missing base pointer. class ReportNoBasePtr : public ReportAffFunc { //===--------------------------------------------------------------------===// public: @@ -381,7 +381,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures an undefined base pointer. +/// Captures an undefined base pointer. class ReportUndefBasePtr : public ReportAffFunc { //===--------------------------------------------------------------------===// public: @@ -400,7 +400,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures a base pointer that is not invariant in the region. +/// Captures a base pointer that is not invariant in the region. class ReportVariantBasePtr : public ReportAffFunc { //===--------------------------------------------------------------------===// @@ -424,7 +424,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures a non-affine access function. +/// Captures a non-affine access function. class ReportNonAffineAccess : public ReportAffFunc { //===--------------------------------------------------------------------===// @@ -455,7 +455,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Report array accesses with differing element size. +/// Report array accesses with differing element size. class ReportDifferentArrayElementSize : public ReportAffFunc { //===--------------------------------------------------------------------===// @@ -479,7 +479,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with non affine loop bounds. +/// Captures errors with non affine loop bounds. class ReportLoopBound : public RejectReason { //===--------------------------------------------------------------------===// @@ -511,11 +511,11 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors when loop overlap with nonaffine subregion. +/// Captures errors when loop overlap with nonaffine subregion. class ReportLoopOverlapWithNonAffineSubRegion : public RejectReason { //===--------------------------------------------------------------------===// - /// @brief If L and R are set then L and R overlap. + /// If L and R are set then L and R overlap. /// The loop contains stmt overlapping nonaffine subregion. Loop *L; @@ -542,7 +542,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with non-side-effect-known function calls. +/// Captures errors with non-side-effect-known function calls. class ReportFuncCall : public RejectReason { //===--------------------------------------------------------------------===// @@ -566,14 +566,14 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with aliasing. +/// Captures errors with aliasing. class ReportAlias : public RejectReason { //===--------------------------------------------------------------------===// public: typedef std::vector<const llvm::Value *> PointerSnapshotTy; private: - /// @brief Format an invalid alias set. + /// Format an invalid alias set. /// // @param Prefix A prefix string to put before the list of aliasing pointers. // @param Suffix A suffix string to put after the list of aliasing pointers. @@ -604,7 +604,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Base class for otherwise ungrouped reject reasons. +/// Base class for otherwise ungrouped reject reasons. class ReportOther : public RejectReason { //===--------------------------------------------------------------------===// public: @@ -622,7 +622,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with bad IntToPtr instructions. +/// Captures errors with bad IntToPtr instructions. class ReportIntToPtr : public ReportOther { //===--------------------------------------------------------------------===// @@ -645,7 +645,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with alloca instructions. +/// Captures errors with alloca instructions. class ReportAlloca : public ReportOther { //===--------------------------------------------------------------------===// Instruction *Inst; @@ -666,7 +666,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with unknown instructions. +/// Captures errors with unknown instructions. class ReportUnknownInst : public ReportOther { //===--------------------------------------------------------------------===// Instruction *Inst; @@ -687,7 +687,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with regions containing the function entry block. +/// Captures errors with regions containing the function entry block. class ReportEntry : public ReportOther { //===--------------------------------------------------------------------===// BasicBlock *BB; @@ -708,7 +708,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Report regions that seem not profitable to be optimized. +/// Report regions that seem not profitable to be optimized. class ReportUnprofitable : public ReportOther { //===--------------------------------------------------------------------===// Region *R; @@ -730,7 +730,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief Captures errors with non-simple memory accesses. +/// Captures errors with non-simple memory accesses. class ReportNonSimpleMemoryAccess : public ReportOther { //===--------------------------------------------------------------------===// diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 93b39a82411..2337021e595 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -66,7 +66,7 @@ class ScopBuilder; //===---------------------------------------------------------------------===// -/// @brief Enumeration of assumptions Polly can take. +/// Enumeration of assumptions Polly can take. enum AssumptionKind { ALIASING, INBOUNDS, @@ -80,7 +80,7 @@ enum AssumptionKind { DELINEARIZATION, }; -/// @brief Enum to distinguish between assumptions and restrictions. +/// Enum to distinguish between assumptions and restrictions. enum AssumptionSign { AS_ASSUMPTION, AS_RESTRICTION }; /// Maps from a loop to the affine function expressing its backedge taken count. @@ -93,14 +93,14 @@ typedef std::map<const Loop *, const SCEV *> LoopBoundMapType; typedef std::vector<std::unique_ptr<MemoryAccess>> AccFuncVector; -/// @brief A class to store information about arrays in the SCoP. +/// A class to store information about arrays in the SCoP. /// /// Objects are accessible via the ScoP, MemoryAccess or the id associated with /// the MemoryAccess access function. /// class ScopArrayInfo { public: - /// @brief The kind of a ScopArrayInfo memory object. + /// The kind of a ScopArrayInfo memory object. /// /// We distinguish between arrays and various scalar memory objects. We use /// the term ``array'' to describe memory objects that consist of a set of @@ -221,7 +221,7 @@ public: MK_ExitPHI }; - /// @brief Construct a ScopArrayInfo object. + /// Construct a ScopArrayInfo object. /// /// @param BasePtr The array base pointer. /// @param ElementType The type of the elements stored in the array. @@ -235,7 +235,7 @@ public: ArrayRef<const SCEV *> DimensionSizes, enum MemoryKind Kind, const DataLayout &DL, Scop *S, const char *BaseName = nullptr); - /// @brief Update the element type of the ScopArrayInfo object. + /// Update the element type of the ScopArrayInfo object. /// /// Memory accesses referencing this ScopArrayInfo object may use /// different element sizes. This function ensures the canonical element type @@ -245,7 +245,7 @@ public: /// @param NewElementType An element type that is used to access this array. void updateElementType(Type *NewElementType); - /// @brief Update the sizes of the ScopArrayInfo object. + /// Update the sizes of the ScopArrayInfo object. /// /// A ScopArrayInfo object may be created without all outer dimensions being /// available. This function is called when new memory accesses are added for @@ -257,31 +257,31 @@ public: /// defined in SAI. bool updateSizes(ArrayRef<const SCEV *> Sizes); - /// @brief Destructor to free the isl id of the base pointer. + /// Destructor to free the isl id of the base pointer. ~ScopArrayInfo(); - /// @brief Set the base pointer to @p BP. + /// Set the base pointer to @p BP. void setBasePtr(Value *BP) { BasePtr = BP; } - /// @brief Return the base pointer. + /// Return the base pointer. Value *getBasePtr() const { return BasePtr; } - /// @brief For indirect accesses return the origin SAI of the BP, else null. + /// For indirect accesses return the origin SAI of the BP, else null. const ScopArrayInfo *getBasePtrOriginSAI() const { return BasePtrOriginSAI; } - /// @brief The set of derived indirect SAIs for this origin SAI. + /// The set of derived indirect SAIs for this origin SAI. const SmallPtrSetImpl<ScopArrayInfo *> &getDerivedSAIs() const { return DerivedSAIs; } - /// @brief Return the number of dimensions. + /// Return the number of dimensions. unsigned getNumberOfDimensions() const { if (Kind == MK_PHI || Kind == MK_ExitPHI || Kind == MK_Value) return 0; return DimensionSizes.size() + 1; } - /// @brief Return the size of dimension @p dim as SCEV*. + /// Return the size of dimension @p dim as SCEV*. // // Scalars do not have array dimensions and the first dimension of // a (possibly multi-dimensional) array also does not carry any size @@ -292,7 +292,7 @@ public: return DimensionSizes[Dim - 1]; } - /// @brief Return the size of dimension @p dim as isl_pw_aff. + /// Return the size of dimension @p dim as isl_pw_aff. // // Scalars do not have array dimensions and the first dimension of // a (possibly multi-dimensional) array also does not carry any size @@ -303,27 +303,27 @@ public: return isl_pw_aff_copy(DimensionSizesPw[Dim - 1]); } - /// @brief Get the canonical element type of this array. + /// Get the canonical element type of this array. /// /// @returns The canonical element type of this array. Type *getElementType() const { return ElementType; } - /// @brief Get element size in bytes. + /// Get element size in bytes. int getElemSizeInBytes() const; - /// @brief Get the name of this memory reference. + /// Get the name of this memory reference. std::string getName() const; - /// @brief Return the isl id for the base pointer. + /// Return the isl id for the base pointer. __isl_give isl_id *getBasePtrId() const; - /// @brief Return what kind of memory this represents. + /// Return what kind of memory this represents. enum MemoryKind getKind() const { return Kind; } - /// @brief Is this array info modeling an llvm::Value? + /// Is this array info modeling an llvm::Value? bool isValueKind() const { return Kind == MK_Value; } - /// @brief Is this array info modeling special PHI node memory? + /// Is this array info modeling special PHI node memory? /// /// During code generation of PHI nodes, there is a need for two kinds of /// virtual storage. The normal one as it is used for all scalar dependences, @@ -335,28 +335,28 @@ public: /// normal scalar array modeling. bool isPHIKind() const { return Kind == MK_PHI; } - /// @brief Is this array info modeling an MK_ExitPHI? + /// Is this array info modeling an MK_ExitPHI? bool isExitPHIKind() const { return Kind == MK_ExitPHI; } - /// @brief Is this array info modeling an array? + /// Is this array info modeling an array? bool isArrayKind() const { return Kind == MK_Array; } - /// @brief Dump a readable representation to stderr. + /// Dump a readable representation to stderr. void dump() const; - /// @brief Print a readable representation to @p OS. + /// Print a readable representation to @p OS. /// /// @param SizeAsPwAff Print the size as isl_pw_aff void print(raw_ostream &OS, bool SizeAsPwAff = false) const; - /// @brief Access the ScopArrayInfo associated with an access function. + /// Access the ScopArrayInfo associated with an access function. static const ScopArrayInfo * getFromAccessFunction(__isl_keep isl_pw_multi_aff *PMA); - /// @brief Access the ScopArrayInfo associated with an isl Id. + /// Access the ScopArrayInfo associated with an isl Id. static const ScopArrayInfo *getFromId(__isl_take isl_id *Id); - /// @brief Get the space of this array access. + /// Get the space of this array access. __isl_give isl_space *getSpace() const; private: @@ -364,16 +364,16 @@ private: DerivedSAIs.insert(DerivedSAI); } - /// @brief For indirect accesses this is the SAI of the BP origin. + /// For indirect accesses this is the SAI of the BP origin. const ScopArrayInfo *BasePtrOriginSAI; - /// @brief For origin SAIs the set of derived indirect SAIs. + /// For origin SAIs the set of derived indirect SAIs. SmallPtrSet<ScopArrayInfo *, 2> DerivedSAIs; - /// @brief The base pointer. + /// The base pointer. AssertingVH<Value> BasePtr; - /// @brief The canonical element type of this array. + /// The canonical element type of this array. /// /// The canonical element type describes the minimal accessible element in /// this array. Not all elements accessed, need to be of the very same type, @@ -382,34 +382,34 @@ private: /// type. Type *ElementType; - /// @brief The isl id for the base pointer. + /// The isl id for the base pointer. isl_id *Id; - /// @brief The sizes of each dimension as SCEV*. + /// The sizes of each dimension as SCEV*. SmallVector<const SCEV *, 4> DimensionSizes; - /// @brief The sizes of each dimension as isl_pw_aff. + /// The sizes of each dimension as isl_pw_aff. SmallVector<isl_pw_aff *, 4> DimensionSizesPw; - /// @brief The type of this scop array info object. + /// The type of this scop array info object. /// /// We distinguish between SCALAR, PHI and ARRAY objects. enum MemoryKind Kind; - /// @brief The data layout of the module. + /// The data layout of the module. const DataLayout &DL; - /// @brief The scop this SAI object belongs to. + /// The scop this SAI object belongs to. Scop &S; }; -/// @brief Represent memory accesses in statements. +/// Represent memory accesses in statements. class MemoryAccess { friend class Scop; friend class ScopStmt; public: - /// @brief The access type of a memory access + /// The access type of a memory access /// /// There are three kind of access types: /// @@ -435,7 +435,7 @@ public: MAY_WRITE = 0x3, }; - /// @brief Reduction access type + /// Reduction access type /// /// Commutative and associative binary operations suitable for reductions enum ReductionType { @@ -451,21 +451,21 @@ private: MemoryAccess(const MemoryAccess &) = delete; const MemoryAccess &operator=(const MemoryAccess &) = delete; - /// @brief A unique identifier for this memory access. + /// A unique identifier for this memory access. /// /// The identifier is unique between all memory accesses belonging to the same /// scop statement. isl_id *Id; - /// @brief What is modeled by this MemoryAccess. + /// What is modeled by this MemoryAccess. /// @see ScopArrayInfo::MemoryKind ScopArrayInfo::MemoryKind Kind; - /// @brief Whether it a reading or writing access, and if writing, whether it + /// Whether it a reading or writing access, and if writing, whether it /// is conditional (MAY_WRITE). enum AccessType AccType; - /// @brief Reduction type for reduction like accesses, RT_NONE otherwise + /// Reduction type for reduction like accesses, RT_NONE otherwise /// /// An access is reduction like if it is part of a load-store chain in which /// both access the same memory location (use the same LLVM-IR value @@ -491,10 +491,10 @@ private: /// could allow us to handle the above example. ReductionType RedType = RT_NONE; - /// @brief Parent ScopStmt of this access. + /// Parent ScopStmt of this access. ScopStmt *Statement; - /// @brief The domain under which this access is not modeled precisely. + /// The domain under which this access is not modeled precisely. /// /// The invalid domain for an access describes all parameter combinations /// under which the statement looks to be executed but is in fact not because @@ -505,7 +505,7 @@ private: // TODO: It might be possible to move them to ScopArrayInfo. // @{ - /// @brief The base address (e.g., A for A[i+j]). + /// The base address (e.g., A for A[i+j]). /// /// The #BaseAddr of a memory access of kind MK_Array is the base pointer /// of the memory access. @@ -515,20 +515,20 @@ private: /// defining the value. AssertingVH<Value> BaseAddr; - /// @brief An unique name of the accessed array. + /// An unique name of the accessed array. std::string BaseName; - /// @brief Type a single array element wrt. this access. + /// Type a single array element wrt. this access. Type *ElementType; - /// @brief Size of each dimension of the accessed array. + /// Size of each dimension of the accessed array. SmallVector<const SCEV *, 4> Sizes; // @} // Properties describing the accessed element. // @{ - /// @brief The access instruction of this memory access. + /// The access instruction of this memory access. /// /// For memory accesses of kind MK_Array the access instruction is the /// Load or Store instruction performing the access. @@ -544,10 +544,10 @@ private: /// write access is the instruction that defines the llvm::Value. Instruction *AccessInstruction; - /// @brief Incoming block and value of a PHINode. + /// Incoming block and value of a PHINode. SmallVector<std::pair<BasicBlock *, Value *>, 4> Incoming; - /// @brief The value associated with this memory access. + /// The value associated with this memory access. /// /// - For array memory accesses (MK_Array) it is the loaded result or the /// stored value. If the access instruction is a memory intrinsic it @@ -558,13 +558,13 @@ private: /// AssertingVH<Value> AccessValue; - /// @brief Are all the subscripts affine expression? + /// Are all the subscripts affine expression? bool IsAffine; - /// @brief Subscript expression for each dimension. + /// Subscript expression for each dimension. SmallVector<const SCEV *, 4> Subscripts; - /// @brief Relation from statement instances to the accessed array elements. + /// Relation from statement instances to the accessed array elements. /// /// In the common case this relation is a function that maps a set of loop /// indices to the memory address from which a value is loaded/stored: @@ -592,7 +592,7 @@ private: /// => { S[i] -> A[i]; S[i] -> A[o] : 4i <= o <= 4i + 3 } isl_map *AccessRelation; - /// @brief Updated access relation read from JSCOP file. + /// Updated access relation read from JSCOP file. isl_map *NewAccessRelation; // @} @@ -602,21 +602,21 @@ private: void assumeNoOutOfBound(); - /// @brief Compute bounds on an over approximated access relation. + /// Compute bounds on an over approximated access relation. /// /// @param ElementSize The size of one element accessed. void computeBoundsOnAccessRelation(unsigned ElementSize); - /// @brief Get the original access function as read from IR. + /// Get the original access function as read from IR. __isl_give isl_map *getOriginalAccessRelation() const; - /// @brief Return the space in which the access relation lives in. + /// Return the space in which the access relation lives in. __isl_give isl_space *getOriginalAccessRelationSpace() const; - /// @brief Get the new access function imported or set by a pass + /// Get the new access function imported or set by a pass __isl_give isl_map *getNewAccessRelation() const; - /// @brief Fold the memory access to consider parameteric offsets + /// Fold the memory access to consider parameteric offsets /// /// To recover memory accesses with array size parameters in the subscript /// expression we post-process the delinearization results. @@ -647,10 +647,10 @@ private: __isl_give isl_map *foldAccess(__isl_take isl_map *AccessRelation, ScopStmt *Statement); - /// @brief Create the access relation for the underlying memory intrinsic. + /// Create the access relation for the underlying memory intrinsic. void buildMemIntrinsicAccessRelation(); - /// @brief Assemble the access relation from all available information. + /// Assemble the access relation from all available information. /// /// In particular, used the information passes in the constructor and the /// parent ScopStmt set by setStatment(). @@ -658,8 +658,8 @@ private: /// @param SAI Info object for the accessed array. void buildAccessRelation(const ScopArrayInfo *SAI); - /// @brief Carry index overflows of dimensions with constant size to the next - /// higher dimension. + /// Carry index overflows of dimensions with constant size to the next higher + /// dimension. /// /// For dimensions that have constant size, modulo the index by the size and /// add up the carry (floored division) to the next higher dimension. This is @@ -674,7 +674,7 @@ private: void wrapConstantDimensions(); public: - /// @brief Create a new MemoryAccess. + /// Create a new MemoryAccess. /// /// @param Stmt The parent statement. /// @param AccessInst The instruction doing the access. @@ -693,7 +693,7 @@ public: StringRef BaseName); ~MemoryAccess(); - /// @brief Add a new incoming block/value pairs for this PHI/ExitPHI access. + /// Add a new incoming block/value pairs for this PHI/ExitPHI access. /// /// @param IncomingBlock The PHI's incoming block. /// @param IncomingValue The value when reacing the PHI from the @p @@ -704,7 +704,7 @@ public: Incoming.emplace_back(std::make_pair(IncomingBlock, IncomingValue)); } - /// @brief Return the list of possible PHI/ExitPHI values. + /// Return the list of possible PHI/ExitPHI values. /// /// After code generation moves some PHIs around during region simplification, /// we cannot reliably locate the original PHI node and its incoming values @@ -715,28 +715,28 @@ public: return Incoming; } - /// @brief Get the type of a memory access. + /// Get the type of a memory access. enum AccessType getType() { return AccType; } - /// @brief Is this a reduction like access? + /// Is this a reduction like access? bool isReductionLike() const { return RedType != RT_NONE; } - /// @brief Is this a read memory access? + /// Is this a read memory access? bool isRead() const { return AccType == MemoryAccess::READ; } - /// @brief Is this a must-write memory access? + /// Is this a must-write memory access? bool isMustWrite() const { return AccType == MemoryAccess::MUST_WRITE; } - /// @brief Is this a may-write memory access? + /// Is this a may-write memory access? bool isMayWrite() const { return AccType == MemoryAccess::MAY_WRITE; } - /// @brief Is this a write memory access? + /// Is this a write memory access? bool isWrite() const { return isMustWrite() || isMayWrite(); } - /// @brief Check if a new access relation was imported or set by a pass. + /// Check if a new access relation was imported or set by a pass. bool hasNewAccessRelation() const { return NewAccessRelation; } - /// @brief Return the newest access relation of this access. + /// Return the newest access relation of this access. /// /// There are two possibilities: /// 1) The original access relation read from the LLVM-IR. @@ -751,12 +751,12 @@ public: : getOriginalAccessRelation(); } - /// @brief Old name of getLatestAccessRelation(). + /// Old name of getLatestAccessRelation(). __isl_give isl_map *getAccessRelation() const { return getLatestAccessRelation(); } - /// @brief Get an isl map describing the memory address accessed. + /// Get an isl map describing the memory address accessed. /// /// In most cases the memory address accessed is well described by the access /// relation obtained with getAccessRelation. However, in case of arrays @@ -771,17 +771,17 @@ public: /// @returns The address function for this memory access. __isl_give isl_map *getAddressFunction() const; - /// @brief Return the access relation after the schedule was applied. + /// Return the access relation after the schedule was applied. __isl_give isl_pw_multi_aff * applyScheduleToAccessRelation(__isl_take isl_union_map *Schedule) const; - /// @brief Get an isl string representing the access function read from IR. + /// Get an isl string representing the access function read from IR. std::string getOriginalAccessRelationStr() const; - /// @brief Get an isl string representing a new access function, if available. + /// Get an isl string representing a new access function, if available. std::string getNewAccessRelationStr() const; - /// @brief Get the base address of this access (e.g. A for A[i+j]) when + /// Get the base address of this access (e.g. A for A[i+j]) when /// detected. Value *getOriginalBaseAddr() const { assert(!getOriginalScopArrayInfo() /* may noy yet be initialized */ || @@ -789,71 +789,71 @@ public: return BaseAddr; } - /// @brief Get the base address of this access (e.g. A for A[i+j]) after a + /// Get the base address of this access (e.g. A for A[i+j]) after a /// potential change by setNewAccessRelation(). Value *getLatestBaseAddr() const { return getLatestScopArrayInfo()->getBasePtr(); } - /// @brief Old name for getOriginalBaseAddr(). + /// Old name for getOriginalBaseAddr(). Value *getBaseAddr() const { return getOriginalBaseAddr(); } - /// @brief Get the detection-time base array isl_id for this access. + /// Get the detection-time base array isl_id for this access. __isl_give isl_id *getOriginalArrayId() const; - /// @brief Get the base array isl_id for this access, modifiable through + /// Get the base array isl_id for this access, modifiable through /// setNewAccessRelation(). __isl_give isl_id *getLatestArrayId() const; - /// @brief Old name of getOriginalArrayId(). + /// Old name of getOriginalArrayId(). __isl_give isl_id *getArrayId() const { return getOriginalArrayId(); } - /// @brief Get the detection-time ScopArrayInfo object for the base address. + /// Get the detection-time ScopArrayInfo object for the base address. const ScopArrayInfo *getOriginalScopArrayInfo() const; - /// @brief Get the ScopArrayInfo object for the base address, or the one set + /// Get the ScopArrayInfo object for the base address, or the one set /// by setNewAccessRelation(). const ScopArrayInfo *getLatestScopArrayInfo() const; - /// @brief Legacy name of getOriginalScopArrayInfo(). + /// Legacy name of getOriginalScopArrayInfo(). const ScopArrayInfo *getScopArrayInfo() const { return getOriginalScopArrayInfo(); } - /// @brief Return a string representation of the access's reduction type. + /// Return a string representation of the access's reduction type. const std::string getReductionOperatorStr() const; - /// @brief Return a string representation of the reduction type @p RT. + /// Return a string representation of the reduction type @p RT. static const std::string getReductionOperatorStr(ReductionType RT); const std::string &getBaseName() const { return BaseName; } - /// @brief Return the element type of the accessed array wrt. this access. + /// Return the element type of the accessed array wrt. this access. Type *getElementType() const { return ElementType; } - /// @brief Return the access value of this memory access. + /// Return the access value of this memory access. Value *getAccessValue() const { return AccessValue; } - /// @brief Return the access instruction of this memory access. + /// Return the access instruction of this memory access. Instruction *getAccessInstruction() const { return AccessInstruction; } - /// @brief Return the number of access function subscript. + /// Return the number of access function subscript. unsigned getNumSubscripts() const { return Subscripts.size(); } - /// @brief Return the access function subscript in the dimension @p Dim. + /// Return the access function subscript in the dimension @p Dim. const SCEV *getSubscript(unsigned Dim) const { return Subscripts[Dim]; } - /// @brief Compute the isl representation for the SCEV @p E wrt. this access. + /// Compute the isl representation for the SCEV @p E wrt. this access. /// /// Note that this function will also adjust the invalid context accordingly. __isl_give isl_pw_aff *getPwAff(const SCEV *E); - /// @brief Get the invalid domain for this access. + /// Get the invalid domain for this access. __isl_give isl_set *getInvalidDomain() const { return isl_set_copy(InvalidDomain); } - /// @brief Get the invalid context for this access. + /// Get the invalid context for this access. __isl_give isl_set *getInvalidContext() const { return isl_set_params(getInvalidDomain()); } @@ -880,33 +880,33 @@ public: /// statement. bool isStrideZero(__isl_take const isl_map *Schedule) const; - /// @brief Return the kind when this access was first detected. + /// Return the kind when this access was first detected. ScopArrayInfo::MemoryKind getOriginalKind() const { assert(!getOriginalScopArrayInfo() /* not yet initialized */ || getOriginalScopArrayInfo()->getKind() == Kind); return Kind; } - /// @brief Return the kind considering a potential setNewAccessRelation. + /// Return the kind considering a potential setNewAccessRelation. ScopArrayInfo::MemoryKind getLatestKind() const { return getLatestScopArrayInfo()->getKind(); } - /// @brief Whether this is an access of an explicit load or store in the IR. + /// Whether this is an access of an explicit load or store in the IR. bool isOriginalArrayKind() const { return getOriginalKind() == ScopArrayInfo::MK_Array; } - /// @brief Whether storage memory is either an custom .s2a/.phiops alloca + /// Whether storage memory is either an custom .s2a/.phiops alloca /// (false) or an existing pointer into an array (true). bool isLatestArrayKind() const { return getLatestKind() == ScopArrayInfo::MK_Array; } - /// @brief Old name of isOriginalArrayKind. + /// Old name of isOriginalArrayKind. bool isArrayKind() const { return isOriginalArrayKind(); } - /// @brief Whether this access is an array to a scalar memory object, without + /// Whether this access is an array to a scalar memory object, without /// considering changes by setNewAccessRelation. /// /// Scalar accesses are accesses to MK_Value, MK_PHI or MK_ExitPHI. @@ -914,88 +914,88 @@ public: return getOriginalKind() != ScopArrayInfo::MK_Array; } - /// @brief Whether this access is an array to a scalar memory object, also + /// Whether this access is an array to a scalar memory object, also /// considering changes by setNewAccessRelation. bool isLatestScalarKind() const { return getLatestKind() != ScopArrayInfo::MK_Array; } - /// @brief Old name of isOriginalScalarKind. + /// Old name of isOriginalScalarKind. bool isScalarKind() const { return isOriginalScalarKind(); } - /// @brief Was this MemoryAccess detected as a scalar dependences? + /// Was this MemoryAccess detected as a scalar dependences? bool isOriginalValueKind() const { return getOriginalKind() == ScopArrayInfo::MK_Value; } - /// @brief Is this MemoryAccess currently modeling scalar dependences? + /// Is this MemoryAccess currently modeling scalar dependences? bool isLatestValueKind() const { return getLatestKind() == ScopArrayInfo::MK_Value; } - /// @brief Old name of isOriginalValueKind(). + /// Old name of isOriginalValueKind(). bool isValueKind() const { return isOriginalValueKind(); } - /// @brief Was this MemoryAccess detected as a special PHI node access? + /// Was this MemoryAccess detected as a special PHI node access? bool isOriginalPHIKind() const { return getOriginalKind() == ScopArrayInfo::MK_PHI; } - /// @brief Is this MemoryAccess modeling special PHI node accesses, also + /// Is this MemoryAccess modeling special PHI node accesses, also /// considering a potential change by setNewAccessRelation? bool isLatestPHIKind() const { return getLatestKind() == ScopArrayInfo::MK_PHI; } - /// @brief Old name of isOriginalPHIKind. + /// Old name of isOriginalPHIKind. bool isPHIKind() const { return isOriginalPHIKind(); } - /// @brief Was this MemoryAccess detected as the accesses of a PHI node in the + /// Was this MemoryAccess detected as the accesses of a PHI node in the /// SCoP's exit block? bool isOriginalExitPHIKind() const { return getOriginalKind() == ScopArrayInfo::MK_ExitPHI; } - /// @brief Is this MemoryAccess modeling the accesses of a PHI node in the + /// Is this MemoryAccess modeling the accesses of a PHI node in the /// SCoP's exit block? Can be changed to an array access using /// setNewAccessRelation(). bool isLatestExitPHIKind() const { return getLatestKind() == ScopArrayInfo::MK_ExitPHI; } - /// @brief Old name of isOriginalExitPHIKind(). + /// Old name of isOriginalExitPHIKind(). bool isExitPHIKind() const { return isOriginalExitPHIKind(); } - /// @brief Was this access detected as one of the two PHI types? + /// Was this access detected as one of the two PHI types? bool isOriginalAnyPHIKind() const { return isOriginalPHIKind() || isOriginalExitPHIKind(); } - /// @brief Does this access orginate from one of the two PHI types? Can be + /// Does this access orginate from one of the two PHI types? Can be /// changed to an array access using setNewAccessRelation(). bool isLatestAnyPHIKind() const { return isLatestPHIKind() || isLatestExitPHIKind(); } - /// @brief Old name of isOriginalAnyPHIKind(). + /// Old name of isOriginalAnyPHIKind(). bool isAnyPHIKind() const { return isOriginalAnyPHIKind(); } - /// @brief Get the statement that contains this memory access. + /// Get the statement that contains this memory access. ScopStmt *getStatement() const { return Statement; } - /// @brief Get the reduction type of this access + /// Get the reduction type of this access ReductionType getReductionType() const { return RedType; } - /// @brief Set the updated access relation read from JSCOP file. + /// Set the updated access relation read from JSCOP file. void setNewAccessRelation(__isl_take isl_map *NewAccessRelation); - /// @brief Mark this a reduction like access + /// Mark this a reduction like access void markAsReductionLike(ReductionType RT) { RedType = RT; } - /// @brief Align the parameters in the access relation to the scop context + /// Align the parameters in the access relation to the scop context void realignParams(); - /// @brief Update the dimensionality of the memory access. + /// Update the dimensionality of the memory access. /// /// During scop construction some memory accesses may not be constructed with /// their full dimensionality, but outer dimensions may have been omitted if @@ -1005,40 +1005,40 @@ public: /// access. void updateDimensionality(); - /// @brief Get identifier for the memory access. + /// Get identifier for the memory access. /// /// This identifier is unique for all accesses that belong to the same scop /// statement. __isl_give isl_id *getId() const; - /// @brief Print the MemoryAccess. + /// Print the MemoryAccess. /// /// @param OS The output stream the MemoryAccess is printed to. void print(raw_ostream &OS) const; - /// @brief Print the MemoryAccess to stderr. + /// Print the MemoryAccess to stderr. void dump() const; }; llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, MemoryAccess::ReductionType RT); -/// @brief Ordered list type to hold accesses. +/// Ordered list type to hold accesses. using MemoryAccessList = std::forward_list<MemoryAccess *>; -/// @brief Helper structure for invariant memory accesses. +/// Helper structure for invariant memory accesses. struct InvariantAccess { - /// @brief The memory access that is (partially) invariant. + /// The memory access that is (partially) invariant. MemoryAccess *MA; - /// @brief The context under which the access is not invariant. + /// The context under which the access is not invariant. isl_set *NonHoistableCtx; }; -/// @brief Ordered container type to hold invariant accesses. +/// Ordered container type to hold invariant accesses. using InvariantAccessesTy = SmallVector<InvariantAccess, 8>; -/// @brief Type for equivalent invariant accesses and their domain context. +/// Type for equivalent invariant accesses and their domain context. struct InvariantEquivClassTy { /// The pointer that identifies this equivalence class @@ -1064,10 +1064,10 @@ struct InvariantEquivClassTy { Type *AccessType; }; -/// @brief Type for invariant accesses equivalence classes. +/// Type for invariant accesses equivalence classes. using InvariantEquivClassesTy = SmallVector<InvariantEquivClassTy, 8>; -/// @brief Statement of the Scop +/// Statement of the Scop /// /// A Scop statement represents an instruction in the Scop. /// @@ -1095,7 +1095,7 @@ private: /// The Scop containing this ScopStmt Scop &Parent; - /// @brief The domain under which this statement is not modeled precisely. + /// The domain under which this statement is not modeled precisely. /// /// The invalid domain for a statement describes all parameter combinations /// under which the statement looks to be executed but is in fact not because @@ -1129,18 +1129,18 @@ private: typedef SmallVector<MemoryAccess *, 8> MemoryAccessVec; MemoryAccessVec MemAccs; - /// @brief Mapping from instructions to (scalar) memory accesses. + /// Mapping from instructions to (scalar) memory accesses. DenseMap<const Instruction *, MemoryAccessList> InstructionToAccess; - /// @brief The set of values defined elsewhere required in this ScopStmt and + /// The set of values defined elsewhere required in this ScopStmt and /// their MK_Value READ MemoryAccesses. DenseMap<Value *, MemoryAccess *> ValueReads; - /// @brief The set of values defined in this ScopStmt that are required + /// The set of values defined in this ScopStmt that are required /// elsewhere, mapped to their MK_Value WRITE MemoryAccesses. DenseMap<Instruction *, MemoryAccess *> ValueWrites; - /// @brief Map from PHI nodes to its incoming value when coming from this + /// Map from PHI nodes to its incoming value when coming from this /// statement. /// /// Non-affine subregions can have multiple exiting blocks that are incoming @@ -1151,22 +1151,23 @@ private: //@} - /// @brief A SCoP statement represents either a basic block (affine/precise - /// case) or a whole region (non-affine case). Only one of the - /// following two members will therefore be set and indicate which - /// kind of statement this is. + /// A SCoP statement represents either a basic block (affine/precise case) or + /// a whole region (non-affine case). + /// + /// Only one of the following two members will therefore be set and indicate + /// which kind of statement this is. /// ///{ - /// @brief The BasicBlock represented by this statement (in the affine case). + /// The BasicBlock represented by this statement (in the affine case). BasicBlock *BB; - /// @brief The region represented by this statement (in the non-affine case). + /// The region represented by this statement (in the non-affine case). Region *R; ///} - /// @brief The isl AST build for the new generated AST. + /// The isl AST build for the new generated AST. isl_ast_build *Build; SmallVector<Loop *, 4> NestLoops; @@ -1177,22 +1178,22 @@ private: //@{ void buildDomain(); - /// @brief Fill NestLoops with loops surrounding this statement. + /// Fill NestLoops with loops surrounding this statement. void collectSurroundingLoops(); - /// @brief Build the access relation of all memory accesses. + /// Build the access relation of all memory accesses. void buildAccessRelations(); - /// @brief Detect and mark reductions in the ScopStmt + /// Detect and mark reductions in the ScopStmt void checkForReductions(); - /// @brief Collect loads which might form a reduction chain with @p StoreMA + /// Collect loads which might form a reduction chain with @p StoreMA void collectCandiateReductionLoads(MemoryAccess *StoreMA, llvm::SmallVectorImpl<MemoryAccess *> &Loads); //@} - /// @brief Derive assumptions about parameter values from GetElementPtrInst + /// Derive assumptions about parameter values from GetElementPtrInst /// /// In case a GEP instruction references into a fixed size array e.g., an /// access A[i][j] into an array A[100x100], LLVM-IR does not guarantee that @@ -1221,82 +1222,82 @@ private: /// or non-optimal run-time checks. void deriveAssumptionsFromGEP(GetElementPtrInst *Inst, LoopInfo &LI); - /// @brief Derive assumptions about parameter values. + /// Derive assumptions about parameter values. void deriveAssumptions(LoopInfo &LI); public: ~ScopStmt(); - /// @brief Get an isl_ctx pointer. + /// Get an isl_ctx pointer. isl_ctx *getIslCtx() const; - /// @brief Get the iteration domain of this ScopStmt. + /// Get the iteration domain of this ScopStmt. /// /// @return The iteration domain of this ScopStmt. __isl_give isl_set *getDomain() const; - /// @brief Get the space of the iteration domain + /// Get the space of the iteration domain /// /// @return The space of the iteration domain __isl_give isl_space *getDomainSpace() const; - /// @brief Get the id of the iteration domain space + /// Get the id of the iteration domain space /// /// @return The id of the iteration domain space __isl_give isl_id *getDomainId() const; - /// @brief Get an isl string representing this domain. + /// Get an isl string representing this domain. std::string getDomainStr() const; - /// @brief Get the schedule function of this ScopStmt. + /// Get the schedule function of this ScopStmt. /// /// @return The schedule function of this ScopStmt. __isl_give isl_map *getSchedule() const; - /// @brief Get an isl string representing this schedule. + /// Get an isl string representing this schedule. std::string getScheduleStr() const; - /// @brief Get the invalid domain for this statement. + /// Get the invalid domain for this statement. __isl_give isl_set *getInvalidDomain() const { return isl_set_copy(InvalidDomain); } - /// @brief Get the invalid context for this statement. + /// Get the invalid context for this statement. __isl_give isl_set *getInvalidContext() const { return isl_set_params(getInvalidDomain()); } - /// @brief Set the invalid context for this statement to @p ID. + /// Set the invalid context for this statement to @p ID. void setInvalidDomain(__isl_take isl_set *ID); - /// @brief Get the BasicBlock represented by this ScopStmt (if any). + /// Get the BasicBlock represented by this ScopStmt (if any). /// /// @return The BasicBlock represented by this ScopStmt, or null if the /// statement represents a region. BasicBlock *getBasicBlock() const { return BB; } - /// @brief Return true if this statement represents a single basic block. + /// Return true if this statement represents a single basic block. bool isBlockStmt() const { return BB != nullptr; } - /// @brief Get the region represented by this ScopStmt (if any). + /// Get the region represented by this ScopStmt (if any). /// /// @return The region represented by this ScopStmt, or null if the statement /// represents a basic block. Region *getRegion() const { return R; } - /// @brief Return true if this statement represents a whole region. + /// Return true if this statement represents a whole region. bool isRegionStmt() const { return R != nullptr; } - /// @brief Return a BasicBlock from this statement. + /// Return a BasicBlock from this statement. /// /// For block statements, it returns the BasicBlock itself. For subregion /// statements, return its entry block. BasicBlock *getEntryBlock() const; - /// @brief Return true if this statement does not contain any accesses. + /// Return true if this statement does not contain any accesses. bool isEmpty() const { return MemAccs.empty(); } - /// @brief Return the only array access for @p Inst, if existing. + /// Return the only array access for @p Inst, if existing. /// /// @param Inst The instruction for which to look up the access. /// @returns The unique array memory access related to Inst or nullptr if @@ -1320,7 +1321,7 @@ public: return ArrayAccess; } - /// @brief Return the only array access for @p Inst. + /// Return the only array access for @p Inst. /// /// @param Inst The instruction for which to look up the access. /// @returns The unique array memory access related to Inst. @@ -1331,7 +1332,7 @@ public: return *ArrayAccess; } - /// @brief Return the MemoryAccess that writes the value of an instruction + /// Return the MemoryAccess that writes the value of an instruction /// defined in this statement, or nullptr if not existing, respectively /// not yet added. MemoryAccess *lookupValueWriteOf(Instruction *Inst) const { @@ -1340,13 +1341,13 @@ public: return ValueWrites.lookup(Inst); } - /// @brief Return the MemoryAccess that reloads a value, or nullptr if not + /// Return the MemoryAccess that reloads a value, or nullptr if not /// existing, respectively not yet added. MemoryAccess *lookupValueReadOf(Value *Inst) const { return ValueReads.lookup(Inst); } - /// @brief Return the PHI write MemoryAccess for the incoming values from any + /// Return the PHI write MemoryAccess for the incoming values from any /// basic block in this ScopStmt, or nullptr if not existing, /// respectively not yet added. MemoryAccess *lookupPHIWriteOf(PHINode *PHI) const { @@ -1354,10 +1355,10 @@ public: return PHIWrites.lookup(PHI); } - /// @brief Add @p Access to this statement's list of accesses. + /// Add @p Access to this statement's list of accesses. void addAccess(MemoryAccess *Access); - /// @brief Remove a MemoryAccess from this statement. + /// Remove a MemoryAccess from this statement. /// /// Note that scalar accesses that are caused by MA will /// be eliminated too. @@ -1379,18 +1380,18 @@ public: const char *getBaseName() const; - /// @brief Set the isl AST build. + /// Set the isl AST build. void setAstBuild(__isl_keep isl_ast_build *B) { Build = B; } - /// @brief Get the isl AST build. + /// Get the isl AST build. __isl_keep isl_ast_build *getAstBuild() const { return Build; } - /// @brief Restrict the domain of the statement. + /// Restrict the domain of the statement. /// /// @param NewDomain The new statement domain. void restrictDomain(__isl_take isl_set *NewDomain); - /// @brief Compute the isl representation for the SCEV @p E in this stmt. + /// Compute the isl representation for the SCEV @p E in this stmt. /// /// @param E The SCEV that should be translated. /// @param NonNegative Flag to indicate the @p E has to be non-negative. @@ -1398,31 +1399,31 @@ public: /// Note that this function will also adjust the invalid context accordingly. __isl_give isl_pw_aff *getPwAff(const SCEV *E, bool NonNegative = false); - /// @brief Get the loop for a dimension. + /// Get the loop for a dimension. /// /// @param Dimension The dimension of the induction variable /// @return The loop at a certain dimension. Loop *getLoopForDimension(unsigned Dimension) const; - /// @brief Align the parameters in the statement to the scop context + /// Align the parameters in the statement to the scop context void realignParams(); - /// @brief Print the ScopStmt. + /// Print the ScopStmt. /// /// @param OS The output stream the ScopStmt is printed to. void print(raw_ostream &OS) const; - /// @brief Print the ScopStmt to stderr. + /// Print the ScopStmt to stderr. void dump() const; }; -/// @brief Print ScopStmt S to raw_ostream O. +/// Print ScopStmt S to raw_ostream O. static inline raw_ostream &operator<<(raw_ostream &O, const ScopStmt &S) { S.print(O); return O; } -/// @brief Static Control Part +/// Static Control Part /// /// A Scop is the polyhedral representation of a control flow region detected /// by the Scop detection. It is generated by translating the LLVM-IR and @@ -1441,17 +1442,17 @@ static inline raw_ostream &operator<<(raw_ostream &O, const ScopStmt &S) { /// can take and relations between different parameters. class Scop { public: - /// @brief Type to represent a pair of minimal/maximal access to an array. + /// Type to represent a pair of minimal/maximal access to an array. using MinMaxAccessTy = std::pair<isl_pw_multi_aff *, isl_pw_multi_aff *>; - /// @brief Vector of minimal/maximal accesses to different arrays. + /// Vector of minimal/maximal accesses to different arrays. using MinMaxVectorTy = SmallVector<MinMaxAccessTy, 4>; - /// @brief Pair of minimal/maximal access vectors representing + /// Pair of minimal/maximal access vectors representing /// read write and read only accesses using MinMaxVectorPairTy = std::pair<MinMaxVectorTy, MinMaxVectorTy>; - /// @brief Vector of pair of minimal/maximal access vectors representing + /// Vector of pair of minimal/maximal access vectors representing /// non read only and read only accesses for each alias group. using MinMaxVectorPairVectorTy = SmallVector<MinMaxVectorPairTy, 4>; @@ -1472,10 +1473,10 @@ private: /// Flag to indicate that the scheduler actually optimized the SCoP. bool IsOptimized; - /// @brief True if the underlying region has a single exiting block. + /// True if the underlying region has a single exiting block. bool HasSingleExitEdge; - /// @brief Flag to remember if the SCoP contained an error block or not. + /// Flag to remember if the SCoP contained an error block or not. bool HasErrorBlock; /// Max loop depth. @@ -1485,13 +1486,13 @@ private: /// The statements in this Scop. StmtSet Stmts; - /// @brief Parameters of this Scop + /// Parameters of this Scop ParameterSetTy Parameters; - /// @brief Mapping from parameters to their ids. + /// Mapping from parameters to their ids. DenseMap<const SCEV *, isl_id *> ParameterIds; - /// @brief The context of the SCoP created during SCoP detection. + /// The context of the SCoP created during SCoP detection. ScopDetection::DetectionContext &DC; /// Isl context. @@ -1503,16 +1504,16 @@ private: /// delete the last object that creates isl objects with the context. std::shared_ptr<isl_ctx> IslCtx; - /// @brief A map from basic blocks to SCoP statements. + /// A map from basic blocks to SCoP statements. DenseMap<BasicBlock *, ScopStmt *> StmtMap; - /// @brief A map from basic blocks to their domains. + /// A map from basic blocks to their domains. DenseMap<BasicBlock *, isl_set *> DomainMap; /// Constraints on parameters. isl_set *Context; - /// @brief The affinator used to translate SCEVs to isl expressions. + /// The affinator used to translate SCEVs to isl expressions. SCEVAffinator Affinator; typedef std::map<std::pair<AssertingVH<const Value>, int>, @@ -1523,22 +1524,22 @@ private: typedef SetVector<ScopArrayInfo *> ArrayInfoSetTy; - /// @brief A map to remember ScopArrayInfo objects for all base pointers. + /// A map to remember ScopArrayInfo objects for all base pointers. /// /// As PHI nodes may have two array info objects associated, we add a flag /// that distinguishes between the PHI node specific ArrayInfo object /// and the normal one. ArrayInfoMapTy ScopArrayInfoMap; - /// @brief A map to remember ScopArrayInfo objects for all names of memory + /// A map to remember ScopArrayInfo objects for all names of memory /// references. ArrayNameMapTy ScopArrayNameMap; - /// @brief A set to remember ScopArrayInfo objects. + /// A set to remember ScopArrayInfo objects. /// @see Scop::ScopArrayInfoMap ArrayInfoSetTy ScopArrayInfoSet; - /// @brief The assumptions under which this scop was built. + /// The assumptions under which this scop was built. /// /// When constructing a scop sometimes the exact representation of a statement /// or condition would be very complex, but there is a common case which is a @@ -1547,7 +1548,7 @@ private: /// this scop and that need to be code generated as a run-time test. isl_set *AssumedContext; - /// @brief The restrictions under which this SCoP was built. + /// The restrictions under which this SCoP was built. /// /// The invalid context is similar to the assumed context as it contains /// constraints over the parameters. However, while we need the constraints @@ -1555,26 +1556,26 @@ private: /// need to be "false". Otherwise they behave the same. isl_set *InvalidContext; - /// @brief Helper struct to remember assumptions. + /// Helper struct to remember assumptions. struct Assumption { - /// @brief The kind of the assumption (e.g., WRAPPING). + /// The kind of the assumption (e.g., WRAPPING). AssumptionKind Kind; - /// @brief Flag to distinguish assumptions and restrictions. + /// Flag to distinguish assumptions and restrictions. AssumptionSign Sign; - /// @brief The valid/invalid context if this is an assumption/restriction. + /// The valid/invalid context if this is an assumption/restriction. isl_set *Set; - /// @brief The location that caused this assumption. + /// The location that caused this assumption. DebugLoc Loc; - /// @brief An optional block whose domain can simplify the assumption. + /// An optional block whose domain can simplify the assumption. BasicBlock *BB; }; - /// @brief Collection to hold taken assumptions. + /// Collection to hold taken assumptions. /// /// There are two reasons why we want to record assumptions first before we /// add them to the assumed/invalid context: @@ -1586,7 +1587,7 @@ private: /// only be simplified later on. SmallVector<Assumption, 8> RecordedAssumptions; - /// @brief The schedule of the SCoP + /// The schedule of the SCoP /// /// The schedule of the SCoP describes the execution order of the statements /// in the scop by assigning each statement instance a possibly @@ -1622,7 +1623,7 @@ private: /// in a schedule tree is given in the isl manual. isl_schedule *Schedule; - /// @brief The set of minimal/maximal accesses for each alias group. + /// The set of minimal/maximal accesses for each alias group. /// /// When building runtime alias checks we look at all memory instructions and /// build so called alias groups. Each group contains a set of accesses to @@ -1637,29 +1638,29 @@ private: /// group to ensure the SCoP is executed in an alias free environment. MinMaxVectorPairVectorTy MinMaxAliasGroups; - /// @brief Mapping from invariant loads to the representing invariant load of + /// Mapping from invariant loads to the representing invariant load of /// their equivalence class. ValueToValueMap InvEquivClassVMap; - /// @brief List of invariant accesses. + /// List of invariant accesses. InvariantEquivClassesTy InvariantEquivClasses; - /// @brief Scop constructor; invoked from ScopBuilder::buildScop. + /// Scop constructor; invoked from ScopBuilder::buildScop. Scop(Region &R, ScalarEvolution &SE, LoopInfo &LI, ScopDetection::DetectionContext &DC); - /// @brief Add the access function to all MemoryAccess objects of the Scop + /// Add the access function to all MemoryAccess objects of the Scop /// created in this pass. void addAccessFunction(MemoryAccess *Access) { AccessFunctions.emplace_back(Access); } //@} - /// @brief Initialize this ScopBuilder. + /// Initialize this ScopBuilder. void init(AliasAnalysis &AA, AssumptionCache &AC, DominatorTree &DT, LoopInfo &LI); - /// @brief Propagate domains that are known due to graph properties. + /// Propagate domains that are known due to graph properties. /// /// As a CFG is mostly structured we use the graph properties to propagate /// domains without the need to compute all path conditions. In particular, if @@ -1685,7 +1686,7 @@ private: BasicBlock *BB, Loop *BBLoop, SmallPtrSetImpl<BasicBlock *> &FinishedExitBlocks, LoopInfo &LI); - /// @brief Compute the union of predecessor domains for @p BB. + /// Compute the union of predecessor domains for @p BB. /// /// To compute the union of all domains of predecessors of @p BB this /// function applies similar reasoning on the CFG structure as described for @@ -1701,7 +1702,7 @@ private: getPredecessorDomainConstraints(BasicBlock *BB, __isl_keep isl_set *Domain, DominatorTree &DT, LoopInfo &LI); - /// @brief Add loop carried constraints to the header block of the loop @p L. + /// Add loop carried constraints to the header block of the loop @p L. /// /// @param L The loop to process. /// @param LI The LoopInfo for the current function. @@ -1709,7 +1710,7 @@ private: /// @returns True if there was no problem and false otherwise. bool addLoopBoundsToHeaderDomain(Loop *L, LoopInfo &LI); - /// @brief 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 for. /// @param DT The DominatorTree for the current function. @@ -1719,7 +1720,7 @@ private: bool buildDomainsWithBranchConstraints(Region *R, DominatorTree &DT, LoopInfo &LI); - /// @brief Propagate the domain constraints through the region @p R. + /// Propagate the domain constraints through the region @p R. /// /// @param R The region we currently build branching conditions for. /// @param DT The DominatorTree for the current function. @@ -1728,7 +1729,7 @@ private: /// @returns True if there was no problem and false otherwise. bool propagateDomainConstraints(Region *R, DominatorTree &DT, LoopInfo &LI); - /// @brief Propagate invalid domains of statements through @p R. + /// Propagate invalid domains of statements through @p R. /// /// This method will propagate invalid statement domains through @p R and at /// the same time add error block domains to them. Additionally, the domains @@ -1742,7 +1743,7 @@ private: /// @returns True if there was no problem and false otherwise. bool propagateInvalidStmtDomains(Region *R, DominatorTree &DT, LoopInfo &LI); - /// @brief Compute the domain for each basic block in @p R. + /// Compute the domain for each basic block in @p R. /// /// @param R The region we currently traverse. /// @param DT The DominatorTree for the current function. @@ -1751,20 +1752,20 @@ private: /// @returns True if there was no problem and false otherwise. bool buildDomains(Region *R, DominatorTree &DT, LoopInfo &LI); - /// @brief Add parameter constraints to @p C that imply a non-empty domain. + /// Add parameter constraints to @p C that imply a non-empty domain. __isl_give isl_set *addNonEmptyDomainConstraints(__isl_take isl_set *C) const; - /// @brief Simplify the SCoP representation + /// Simplify the SCoP representation void simplifySCoP(bool AfterHoisting); - /// @brief Return the access for the base ptr of @p MA if any. + /// Return the access for the base ptr of @p MA if any. MemoryAccess *lookupBasePtrAccess(MemoryAccess *MA); - /// @brief Check if the base ptr of @p MA is in the SCoP but not hoistable. + /// Check if the base ptr of @p MA is in the SCoP but not hoistable. bool hasNonHoistableBasePtrInScop(MemoryAccess *MA, __isl_keep isl_union_map *Writes); - /// @brief Create equivalence classes for required invariant accesses. + /// Create equivalence classes for required invariant accesses. /// /// These classes will consolidate multiple required invariant loads from the /// same address in order to keep the number of dimensions in the SCoP @@ -1778,7 +1779,7 @@ private: /// invariant location. void buildInvariantEquivalenceClasses(); - /// @brief Return the context under which the access cannot be hoisted. + /// Return the context under which the access cannot be hoisted. /// /// @param Access The access to check. /// @param Writes The set of all memory writes in the scop. @@ -1788,7 +1789,7 @@ private: __isl_give isl_set *getNonHoistableCtx(MemoryAccess *Access, __isl_keep isl_union_map *Writes); - /// @brief Verify that all required invariant loads have been hoisted. + /// Verify that all required invariant loads have been hoisted. /// /// Invariant load hoisting is not guaranteed to hoist all loads that were /// assumed to be scop invariant during scop detection. This function checks @@ -1804,7 +1805,7 @@ private: /// void verifyInvariantLoads(); - /// @brief Hoist invariant memory loads and check for required ones. + /// Hoist invariant memory loads and check for required ones. /// /// We first identify "common" invariant loads, thus loads that are invariant /// and can be hoisted. Then we check if all required invariant loads have @@ -1824,28 +1825,28 @@ private: /// void hoistInvariantLoads(); - /// @brief Add invariant loads listed in @p InvMAs with the domain of @p Stmt. + /// Add invariant loads listed in @p InvMAs with the domain of @p Stmt. void addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs); - /// @brief Create an id for @p Param and store it in the ParameterIds map. + /// Create an id for @p Param and store it in the ParameterIds map. void createParameterId(const SCEV *Param); - /// @brief Build the Context of the Scop. + /// Build the Context of the Scop. void buildContext(); - /// @brief Add user provided parameter constraints to context (source code). + /// Add user provided parameter constraints to context (source code). void addUserAssumptions(AssumptionCache &AC, DominatorTree &DT, LoopInfo &LI); - /// @brief Add user provided parameter constraints to context (command line). + /// Add user provided parameter constraints to context (command line). void addUserContext(); - /// @brief Add the bounds of the parameters to the context. + /// Add the bounds of the parameters to the context. void addParameterBounds(); - /// @brief Simplify the assumed and invalid context. + /// Simplify the assumed and invalid context. void simplifyContexts(); - /// @brief Get the representing SCEV for @p S if applicable, otherwise @p S. + /// Get the representing SCEV for @p S if applicable, otherwise @p S. /// /// Invariant loads of the same location are put in an equivalence class and /// only one of them is chosen as a representing element that will be @@ -1858,7 +1859,7 @@ private: /// @return The representing SCEV for invariant loads or @p S if none. const SCEV *getRepresentingInvariantLoadSCEV(const SCEV *S); - /// @brief Create a new SCoP statement for either @p BB or @p R. + /// Create a new SCoP statement for either @p BB or @p R. /// /// Either @p BB or @p R should be non-null. A new statement for the non-null /// argument will be created and added to the statement vector and map. @@ -1876,12 +1877,12 @@ private: /// the dimensionality of the underlying ScopArrayInfo object. void updateAccessDimensionality(); - /// @brief Construct the schedule of this SCoP. + /// Construct the schedule of this SCoP. /// /// @param LI The LoopInfo for the current function. void buildSchedule(LoopInfo &LI); - /// @brief A loop stack element to keep track of per-loop information during + /// A loop stack element to keep track of per-loop information during /// schedule construction. typedef struct LoopStackElement { // The loop for which we keep information. @@ -1899,7 +1900,7 @@ private: : L(L), Schedule(S), NumBlocksProcessed(NumBlocksProcessed) {} } LoopStackElementTy; - /// @brief The loop stack used for schedule construction. + /// The loop stack used for schedule construction. /// /// The loop stack keeps track of schedule information for a set of nested /// loops as well as an (optional) 'nullptr' loop that models the outermost @@ -1908,7 +1909,7 @@ private: /// position n + 1. typedef SmallVector<LoopStackElementTy, 4> LoopStackTy; - /// @brief Construct schedule information for a given Region and add the + /// Construct schedule information for a given Region and add the /// derived information to @p LoopStack. /// /// Given a Region we derive schedule information for all RegionNodes @@ -1921,7 +1922,7 @@ private: /// @param LI The LoopInfo for the current function. void buildSchedule(Region *R, LoopStackTy &LoopStack, LoopInfo &LI); - /// @brief Build Schedule for the region node @p RN and add the derived + /// Build Schedule for the region node @p RN and add the derived /// information to @p LoopStack. /// /// In case @p RN is a BasicBlock or a non-affine Region, we construct the @@ -1937,7 +1938,7 @@ private: /// @param LI The LoopInfo for the current function. void buildSchedule(RegionNode *RN, LoopStackTy &LoopStack, LoopInfo &LI); - /// @brief Collect all memory access relations of a given type. + /// Collect all memory access relations of a given type. /// /// @param Predicate A predicate function that returns true if an access is /// of a given type. @@ -1962,15 +1963,15 @@ public: ScalarEvolution *getSE() const; - /// @brief Get the count of parameters used in this Scop. + /// Get the count of parameters used in this Scop. /// /// @return The count of parameters used in this Scop. size_t getNumParams() const { return Parameters.size(); } - /// @brief Take a list of parameters and add the new ones to the scop. + /// Take a list of parameters and add the new ones to the scop. void addParams(const ParameterSetTy &NewParameters); - /// @brief Return whether this scop is empty, i.e. contains no statements that + /// Return whether this scop is empty, i.e. contains no statements that /// could be executed. bool isEmpty() const { return Stmts.empty(); } @@ -1999,89 +2000,89 @@ public: return const_array_range(array_begin(), array_end()); } - /// @brief Return the isl_id that represents a certain parameter. + /// Return the isl_id that represents a certain parameter. /// /// @param Parameter A SCEV that was recognized as a Parameter. /// /// @return The corresponding isl_id or NULL otherwise. __isl_give isl_id *getIdForParam(const SCEV *Parameter); - /// @brief Get the maximum region of this static control part. + /// Get the maximum region of this static control part. /// /// @return The maximum region of this static control part. inline const Region &getRegion() const { return R; } inline Region &getRegion() { return R; } - /// @brief Return the function this SCoP is in. + /// Return the function this SCoP is in. Function &getFunction() const { return *R.getEntry()->getParent(); } - /// @brief Check if @p L is contained in the SCoP. + /// Check if @p L is contained in the SCoP. bool contains(const Loop *L) const { return R.contains(L); } - /// @brief Check if @p BB is contained in the SCoP. + /// Check if @p BB is contained in the SCoP. bool contains(const BasicBlock *BB) const { return R.contains(BB); } - /// @brief Check if @p I is contained in the SCoP. + /// Check if @p I is contained in the SCoP. bool contains(const Instruction *I) const { return R.contains(I); } - /// @brief Return the unique exit block of the SCoP. + /// Return the unique exit block of the SCoP. BasicBlock *getExit() const { return R.getExit(); } - /// @brief Return the unique exiting block of the SCoP if any. + /// Return the unique exiting block of the SCoP if any. BasicBlock *getExitingBlock() const { return R.getExitingBlock(); } - /// @brief Return the unique entry block of the SCoP. + /// Return the unique entry block of the SCoP. BasicBlock *getEntry() const { return R.getEntry(); } - /// @brief Return the unique entering block of the SCoP if any. + /// Return the unique entering block of the SCoP if any. BasicBlock *getEnteringBlock() const { return R.getEnteringBlock(); } - /// @brief Return true if @p BB is the exit block of the SCoP. + /// Return true if @p BB is the exit block of the SCoP. bool isExit(BasicBlock *BB) const { return getExit() == BB; } - /// @brief Return a range of all basic blocks in the SCoP. + /// Return a range of all basic blocks in the SCoP. Region::block_range blocks() const { return R.blocks(); } - /// @brief Return true if and only if @p BB dominates the SCoP. + /// Return true if and only if @p BB dominates the SCoP. bool isDominatedBy(const DominatorTree &DT, BasicBlock *BB) const; - /// @brief Get the maximum depth of the loop. + /// Get the maximum depth of the loop. /// /// @return The maximum depth of the loop. inline unsigned getMaxLoopDepth() const { return MaxLoopDepth; } - /// @brief Return the invariant equivalence class for @p Val if any. + /// Return the invariant equivalence class for @p Val if any. InvariantEquivClassTy *lookupInvariantEquivClass(Value *Val); - /// @brief Return the set of invariant accesses. + /// Return the set of invariant accesses. InvariantEquivClassesTy &getInvariantAccesses() { return InvariantEquivClasses; } - /// @brief Check if the scop has any invariant access. + /// Check if the scop has any invariant access. bool hasInvariantAccesses() { return !InvariantEquivClasses.empty(); } - /// @brief Mark the SCoP as optimized by the scheduler. + /// Mark the SCoP as optimized by the scheduler. void markAsOptimized() { IsOptimized = true; } - /// @brief Check if the SCoP has been optimized by the scheduler. + /// Check if the SCoP has been optimized by the scheduler. bool isOptimized() const { return IsOptimized; } - /// @brief Get the name of this Scop. + /// Get the name of this Scop. std::string getNameStr() const; - /// @brief Get the constraint on parameter of this Scop. + /// Get the constraint on parameter of this Scop. /// /// @return The constraint on parameter of this Scop. __isl_give isl_set *getContext() const; __isl_give isl_space *getParamSpace() const; - /// @brief Get the assumed context for this Scop. + /// Get the assumed context for this Scop. /// /// @return The assumed context of this Scop. __isl_give isl_set *getAssumedContext() const; - /// @brief Return true if the optimized SCoP can be executed. + /// Return true if the optimized SCoP can be executed. /// /// In addition to the runtime check context this will also utilize the domain /// constraints to decide it the optimized version can actually be executed. @@ -2089,7 +2090,7 @@ public: /// @returns True if the optimized SCoP can be executed. bool hasFeasibleRuntimeContext() const; - /// @brief Check if the assumption in @p Set is trivial or not. + /// Check if the assumption in @p Set is trivial or not. /// /// @param Set The relations between parameters that are assumed to hold. /// @param Sign Enum to indicate if the assumptions in @p Set are positive @@ -2098,7 +2099,7 @@ public: /// @returns True if the assumption @p Set is not trivial. bool isEffectiveAssumption(__isl_keep isl_set *Set, AssumptionSign Sign); - /// @brief Track and report an assumption. + /// Track and report an assumption. /// /// Use 'clang -Rpass-analysis=polly-scops' or 'opt /// -pass-remarks-analysis=polly-scops' to output the assumptions. @@ -2113,7 +2114,7 @@ public: bool trackAssumption(AssumptionKind Kind, __isl_keep isl_set *Set, DebugLoc Loc, AssumptionSign Sign); - /// @brief Add assumptions to assumed context. + /// Add assumptions to assumed context. /// /// The assumptions added will be assumed to hold during the execution of the /// scop. However, as they are generally not statically provable, at code @@ -2132,7 +2133,7 @@ public: void addAssumption(AssumptionKind Kind, __isl_take isl_set *Set, DebugLoc Loc, AssumptionSign Sign); - /// @brief Record an assumption for later addition to the assumed context. + /// Record an assumption for later addition to the assumed context. /// /// This function will add the assumption to the RecordedAssumptions. This /// collection will be added (@see addAssumption) to the assumed context once @@ -2151,10 +2152,10 @@ public: DebugLoc Loc, AssumptionSign Sign, BasicBlock *BB = nullptr); - /// @brief Add all recorded assumptions to the assumed context. + /// Add all recorded assumptions to the assumed context. void addRecordedAssumptions(); - /// @brief Mark the scop as invalid. + /// Mark the scop as invalid. /// /// This method adds an assumption to the scop that is always invalid. As a /// result, the scop will not be optimized later on. This function is commonly @@ -2165,58 +2166,58 @@ public: /// @param Loc The location in the source that triggered . void invalidate(AssumptionKind Kind, DebugLoc Loc); - /// @brief Get the invalid context for this Scop. + /// Get the invalid context for this Scop. /// /// @return The invalid context of this Scop. __isl_give isl_set *getInvalidContext() const; - /// @brief Return true if and only if the InvalidContext is trivial (=empty). + /// Return true if and only if the InvalidContext is trivial (=empty). bool hasTrivialInvalidContext() const { return isl_set_is_empty(InvalidContext); } - /// @brief Build the alias checks for this SCoP. + /// Build the alias checks for this SCoP. bool buildAliasChecks(AliasAnalysis &AA); - /// @brief Build all alias groups for this SCoP. + /// Build all alias groups for this SCoP. /// /// @returns True if __no__ error occurred, false otherwise. bool buildAliasGroups(AliasAnalysis &AA); - /// @brief Return all alias groups for this SCoP. + /// Return all alias groups for this SCoP. const MinMaxVectorPairVectorTy &getAliasGroups() const { return MinMaxAliasGroups; } - /// @brief Get an isl string representing the context. + /// Get an isl string representing the context. std::string getContextStr() const; - /// @brief Get an isl string representing the assumed context. + /// Get an isl string representing the assumed context. std::string getAssumedContextStr() const; - /// @brief Get an isl string representing the invalid context. + /// Get an isl string representing the invalid context. std::string getInvalidContextStr() const; - /// @brief Return the ScopStmt for the given @p BB or nullptr if there is + /// Return the ScopStmt for the given @p BB or nullptr if there is /// none. ScopStmt *getStmtFor(BasicBlock *BB) const; - /// @brief Return the ScopStmt that represents the Region @p R, or nullptr if + /// Return the ScopStmt that represents the Region @p R, or nullptr if /// it is not represented by any statement in this Scop. ScopStmt *getStmtFor(Region *R) const; - /// @brief Return the ScopStmt that represents @p RN; can return nullptr if + /// Return the ScopStmt that represents @p RN; can return nullptr if /// the RegionNode is not within the SCoP or has been removed due to /// simplifications. ScopStmt *getStmtFor(RegionNode *RN) const; - /// @brief Return the ScopStmt an instruction belongs to, or nullptr if it + /// Return the ScopStmt an instruction belongs to, or nullptr if it /// does not belong to any statement in this Scop. ScopStmt *getStmtFor(Instruction *Inst) const { return getStmtFor(Inst->getParent()); } - /// @brief Return the number of statements in the SCoP. + /// Return the number of statements in the SCoP. size_t getSize() const { return Stmts.size(); } /// @name Statements Iterators @@ -2240,30 +2241,30 @@ public: const_reverse_iterator rend() const { return Stmts.rend(); } //@} - /// @brief Return the set of required invariant loads. + /// Return the set of required invariant loads. const InvariantLoadsSetTy &getRequiredInvariantLoads() const { return DC.RequiredILS; } - /// @brief Add @p LI to the set of required invariant loads. + /// Add @p LI to the set of required invariant loads. void addRequiredInvariantLoad(LoadInst *LI) { DC.RequiredILS.insert(LI); } - /// @brief Return true if and only if @p LI is a required invariant load. + /// Return true if and only if @p LI is a required invariant load. bool isRequiredInvariantLoad(LoadInst *LI) const { return getRequiredInvariantLoads().count(LI); } - /// @brief Return the set of boxed (thus overapproximated) loops. + /// Return the set of boxed (thus overapproximated) loops. const BoxedLoopsSetTy &getBoxedLoops() const { return DC.BoxedLoopsSet; } - /// @brief Return true if and only if @p R is a non-affine subregion. + /// Return true if and only if @p R is a non-affine subregion. bool isNonAffineSubRegion(const Region *R) { return DC.NonAffineSubRegionSet.count(R); } const MapInsnToMemAcc &getInsnToMemAccMap() const { return DC.InsnToMemAcc; } - /// @brief Return the (possibly new) ScopArrayInfo object for @p Access. + /// Return the (possibly new) ScopArrayInfo object for @p Access. /// /// @param ElementType The type of the elements stored in this array. /// @param Kind The kind of the array info object. @@ -2274,7 +2275,7 @@ public: ScopArrayInfo::MemoryKind Kind, const char *BaseName = nullptr); - /// @brief Create an array and return the corresponding ScopArrayInfo object. + /// Create an array and return the corresponding ScopArrayInfo object. /// /// @param ElementType The type of the elements stored in this array. /// @param BaseName The name of this memory reference. @@ -2283,14 +2284,14 @@ public: const std::string &BaseName, const std::vector<unsigned> &Sizes); - /// @brief Return the cached ScopArrayInfo object for @p BasePtr. + /// Return the cached ScopArrayInfo object for @p BasePtr. /// /// @param BasePtr The base pointer the object has been stored for. /// @param Kind The kind of array info object. const ScopArrayInfo *getScopArrayInfo(Value *BasePtr, ScopArrayInfo::MemoryKind Kind); - /// @brief Invalidate ScopArrayInfo object for base address. + /// Invalidate ScopArrayInfo object for base address. /// /// @param BasePtr The base pointer of the ScopArrayInfo object to invalidate. /// @param Kind The Kind of the ScopArrayInfo object. @@ -2304,35 +2305,35 @@ public: void setContext(__isl_take isl_set *NewContext); - /// @brief Align the parameters in the statement to the scop context + /// Align the parameters in the statement to the scop context void realignParams(); - /// @brief Return true if this SCoP can be profitably optimized. + /// Return true if this SCoP can be profitably optimized. bool isProfitable() const; - /// @brief Return true if the SCoP contained at least one error block. + /// Return true if the SCoP contained at least one error block. bool hasErrorBlock() const { return HasErrorBlock; } - /// @brief Return true if the underlying region has a single exiting block. + /// Return true if the underlying region has a single exiting block. bool hasSingleExitEdge() const { return HasSingleExitEdge; } - /// @brief Print the static control part. + /// Print the static control part. /// /// @param OS The output stream the static control part is printed to. void print(raw_ostream &OS) const; - /// @brief Print the ScopStmt to stderr. + /// Print the ScopStmt to stderr. void dump() const; - /// @brief Get the isl context of this static control part. + /// Get the isl context of this static control part. /// /// @return The isl context of this static control part. isl_ctx *getIslCtx() const; - /// @brief Directly return the shared_ptr of the context. + /// Directly return the shared_ptr of the context. const std::shared_ptr<isl_ctx> &getSharedIslCtx() const { return IslCtx; } - /// @brief Compute the isl representation for the SCEV @p E + /// Compute the isl representation for the SCEV @p E /// /// @param E The SCEV that should be translated. /// @param BB An (optional) basic block in which the isl_pw_aff is computed. @@ -2347,62 +2348,62 @@ public: __isl_give PWACtx getPwAff(const SCEV *E, BasicBlock *BB = nullptr, bool NonNegative = false); - /// @brief Compute the isl representation for the SCEV @p E + /// Compute the isl representation for the SCEV @p E /// /// This function is like @see Scop::getPwAff() but strips away the invalid /// domain part associated with the piecewise affine function. __isl_give isl_pw_aff *getPwAffOnly(const SCEV *E, BasicBlock *BB = nullptr); - /// @brief Return the domain of @p Stmt. + /// Return the domain of @p Stmt. /// /// @param Stmt The statement for which the conditions should be returned. __isl_give isl_set *getDomainConditions(const ScopStmt *Stmt) const; - /// @brief Return the domain of @p BB. + /// Return the domain of @p BB. /// /// @param BB The block for which the conditions should be returned. __isl_give isl_set *getDomainConditions(BasicBlock *BB) const; - /// @brief Get a union set containing the iteration domains of all statements. + /// Get a union set containing the iteration domains of all statements. __isl_give isl_union_set *getDomains() const; - /// @brief 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_give isl_union_map *getMayWrites(); - /// @brief 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_give isl_union_map *getMustWrites(); - /// @brief Get a union map of all writes performed in the SCoP. + /// Get a union map of all writes performed in the SCoP. __isl_give isl_union_map *getWrites(); - /// @brief Get a union map of all reads performed in the SCoP. + /// Get a union map of all reads performed in the SCoP. __isl_give isl_union_map *getReads(); - /// @brief Get a union map of all memory accesses performed in the SCoP. + /// Get a union map of all memory accesses performed in the SCoP. __isl_give isl_union_map *getAccesses(); - /// @brief Get the schedule of all the statements in the SCoP. + /// Get the schedule of all the statements in the SCoP. __isl_give isl_union_map *getSchedule() const; - /// @brief Get a schedule tree describing the schedule of all statements. + /// Get a schedule tree describing the schedule of all statements. __isl_give isl_schedule *getScheduleTree() const; - /// @brief Update the current schedule + /// Update the current schedule /// - /// @brief NewSchedule The new schedule (given as a flat union-map). + /// NewSchedule The new schedule (given as a flat union-map). void setSchedule(__isl_take isl_union_map *NewSchedule); - /// @brief Update the current schedule + /// Update the current schedule /// - /// @brief NewSchedule The new schedule (given as schedule tree). + /// NewSchedule The new schedule (given as schedule tree). void setScheduleTree(__isl_take isl_schedule *NewSchedule); - /// @brief Intersects the domains of all statements in the SCoP. + /// Intersects the domains of all statements in the SCoP. /// /// @return true if a change was made bool restrictDomains(__isl_take isl_union_set *Domain); - /// @brief Get the depth of a loop relative to the outermost loop in the Scop. + /// Get the depth of a loop relative to the outermost loop in the Scop. /// /// This will return /// 0 if @p L is an outermost loop in the SCoP @@ -2410,21 +2411,21 @@ public: /// -1 if @p L is nullptr or there is no outermost loop in the SCoP int getRelativeLoopDepth(const Loop *L) const; - /// @brief Find the ScopArrayInfo associated with an isl Id + /// Find the ScopArrayInfo associated with an isl Id /// that has name @p Name. ScopArrayInfo *getArrayInfoByName(const std::string BaseName); }; -/// @brief Print Scop scop to raw_ostream O. +/// Print Scop scop to raw_ostream O. static inline raw_ostream &operator<<(raw_ostream &O, const Scop &scop) { scop.print(O); return O; } -/// @brief The legacy pass manager's analysis pass to compute scop information +/// The legacy pass manager's analysis pass to compute scop information /// for a region. class ScopInfoRegionPass : public RegionPass { - /// @brief The Scop pointer which is used to construct a Scop. + /// The Scop pointer which is used to construct a Scop. std::unique_ptr<Scop> S; public: @@ -2433,7 +2434,7 @@ public: ScopInfoRegionPass() : RegionPass(ID) {} ~ScopInfoRegionPass() {} - /// @brief Build Scop object, the Polly IR of static control + /// Build Scop object, the Polly IR of static control /// part for the current SESE-Region. /// /// @return If the current region is a valid for a static control part, @@ -2442,7 +2443,7 @@ public: Scop *getScop() { return S.get(); } const Scop *getScop() const { return S.get(); } - /// @brief Calculate the polyhedral scop information for a given Region. + /// Calculate the polyhedral scop information for a given Region. bool runOnRegion(Region *R, RGPassManager &RGM) override; void releaseMemory() override { S.reset(); } @@ -2453,7 +2454,7 @@ public: }; //===----------------------------------------------------------------------===// -/// @brief The legacy pass manager's analysis pass to compute scop information +/// The legacy pass manager's analysis pass to compute scop information /// for the whole function. /// /// This pass will maintain a map of the maximal region within a scop to its @@ -2468,7 +2469,7 @@ public: using const_iterator = RegionToScopMapTy::const_iterator; private: - /// @brief A map of Region to its Scop object containing + /// A map of Region to its Scop object containing /// Polly IR of static control part RegionToScopMapTy RegionToScopMap; @@ -2478,7 +2479,7 @@ public: ScopInfoWrapperPass() : FunctionPass(ID) {} ~ScopInfoWrapperPass() {} - /// @brief Get the Scop object for the given Region + /// Get the Scop object for the given Region /// /// @return If the given region is the maximal region within a scop, return /// the scop object. If the given region is a subregion, return a @@ -2496,7 +2497,7 @@ public: const_iterator begin() const { return RegionToScopMap.begin(); } const_iterator end() const { return RegionToScopMap.end(); } - /// @brief Calculate all the polyhedral scops for a given function. + /// Calculate all the polyhedral scops for a given function. bool runOnFunction(Function &F) override; void releaseMemory() override { RegionToScopMap.clear(); } diff --git a/polly/include/polly/ScopPass.h b/polly/include/polly/ScopPass.h index ca20cbaaf83..9f916bf8ffc 100644 --- a/polly/include/polly/ScopPass.h +++ b/polly/include/polly/ScopPass.h @@ -39,7 +39,7 @@ protected: /// virtual bool runOnScop(Scop &S) = 0; - /// @brief Print method for SCoPs. + /// Print method for SCoPs. virtual void printScop(raw_ostream &OS, Scop &S) const {} /// getAnalysisUsage - Subclasses that override getAnalysisUsage diff --git a/polly/include/polly/Support/GICHelper.h b/polly/include/polly/Support/GICHelper.h index e4861eb9b0b..a694bb938ec 100644 --- a/polly/include/polly/Support/GICHelper.h +++ b/polly/include/polly/Support/GICHelper.h @@ -38,7 +38,7 @@ class Value; namespace polly { -/// @brief Translate an llvm::APInt to an isl_val. +/// Translate an llvm::APInt to an isl_val. /// /// Translate the bitsequence without sign information as provided by APInt into /// a signed isl_val type. Depending on the value of @p IsSigned @p Int is @@ -70,7 +70,7 @@ namespace polly { __isl_give isl_val *isl_valFromAPInt(isl_ctx *Ctx, const llvm::APInt Int, bool IsSigned); -/// @brief Translate isl_val to llvm::APInt. +/// Translate isl_val to llvm::APInt. /// /// This function can only be called on isl_val values which are integers. /// Calling this function with a non-integral rational, NaN or infinity value @@ -99,7 +99,7 @@ __isl_give isl_val *isl_valFromAPInt(isl_ctx *Ctx, const llvm::APInt Int, /// @return The APInt value corresponding to @p Val. llvm::APInt APIntFromVal(__isl_take isl_val *Val); -/// @brief Get c++ string from Isl objects. +/// Get c++ string from Isl objects. //@{ std::string stringFromIslObj(__isl_keep isl_map *map); std::string stringFromIslObj(__isl_keep isl_union_map *umap); @@ -168,7 +168,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, return OS; } -/// @brief Return @p Prefix + @p Val->getName() + @p Suffix but Isl compatible. +/// Return @p Prefix + @p Val->getName() + @p Suffix but Isl compatible. std::string getIslCompatibleName(const std::string &Prefix, const llvm::Value *Val, const std::string &Suffix); diff --git a/polly/include/polly/Support/SCEVAffinator.h b/polly/include/polly/Support/SCEVAffinator.h index 011688a8987..88c1c101f2d 100644 --- a/polly/include/polly/Support/SCEVAffinator.h +++ b/polly/include/polly/Support/SCEVAffinator.h @@ -43,7 +43,7 @@ namespace polly { class Scop; class ScopStmt; -/// @brief The result type of the SCEVAffinator. +/// The result type of the SCEVAffinator. /// /// The first element of the pair is the isl representation of the SCEV, the /// second is the domain under which it is __invalid__. @@ -55,7 +55,7 @@ public: SCEVAffinator(Scop *S, llvm::LoopInfo &LI); ~SCEVAffinator(); - /// @brief Translate a SCEV to an isl_pw_aff. + /// Translate a SCEV to an isl_pw_aff. /// /// @param E he expression that is translated. /// @param BB The block in which @p E is executed. @@ -64,20 +64,20 @@ public: __isl_give PWACtx getPwAff(const llvm::SCEV *E, llvm::BasicBlock *BB = nullptr); - /// @brief Take the asumption that @p PWAC is non-negative. + /// Take the asumption that @p PWAC is non-negative. void takeNonNegativeAssumption(PWACtx &PWAC); - /// @brief Interpret the PWA in @p PWAC as an unsigned value. + /// Interpret the PWA in @p PWAC as an unsigned value. void interpretAsUnsigned(__isl_keep PWACtx &PWAC, unsigned Width); - /// @brief Check an <nsw> AddRec for the loop @p L is cached. + /// Check an <nsw> AddRec for the loop @p L is cached. bool hasNSWAddRecForLoop(llvm::Loop *L) const; private: - /// @brief Key to identify cached expressions. + /// Key to identify cached expressions. using CacheKey = std::pair<const llvm::SCEV *, llvm::BasicBlock *>; - /// @brief Map to remembered cached expressions. + /// Map to remembered cached expressions. llvm::DenseMap<CacheKey, PWACtx> CachedExpressions; Scop *S; @@ -87,16 +87,16 @@ private: llvm::LoopInfo &LI; llvm::BasicBlock *BB; - /// @brief Target data for element size computing. + /// Target data for element size computing. const llvm::DataLayout &TD; - /// @brief Return the loop for the current block if any. + /// Return the loop for the current block if any. llvm::Loop *getScope(); - /// @brief Return a PWACtx for @p PWA that is always valid. + /// Return a PWACtx for @p PWA that is always valid. __isl_give PWACtx getPWACtxFromPWA(__isl_take isl_pw_aff *PWA); - /// @brief Compute the non-wrapping version of @p PWA for type @p ExprType. + /// Compute the non-wrapping version of @p PWA for type @p ExprType. /// /// @param PWA The piece-wise affine function that might wrap. /// @param Type The type of the SCEV that was translated to @p PWA. @@ -105,7 +105,7 @@ private: __isl_give isl_pw_aff *addModuloSemantic(__isl_take isl_pw_aff *PWA, llvm::Type *ExprType) const; - /// @brief If @p Expr might cause an integer wrap record an assumption. + /// If @p Expr might cause an integer wrap record an assumption. /// /// @param Expr The SCEV expression that might wrap. /// @param PWAC The isl representation of @p Expr with the invalid domain. diff --git a/polly/include/polly/Support/SCEVValidator.h b/polly/include/polly/Support/SCEVValidator.h index 996044b48f5..9a293786e3b 100644 --- a/polly/include/polly/Support/SCEVValidator.h +++ b/polly/include/polly/Support/SCEVValidator.h @@ -26,14 +26,14 @@ class LoadInst; } // namespace llvm namespace polly { -/// @brief Find the loops referenced from a SCEV expression. +/// Find the loops referenced from a SCEV expression. /// /// @param Expr The SCEV expression to scan for loops. /// @param Loops A vector into which the found loops are inserted. void findLoops(const llvm::SCEV *Expr, llvm::SetVector<const llvm::Loop *> &Loops); -/// @brief Find the values referenced by SCEVUnknowns in a given SCEV +/// Find the values referenced by SCEVUnknowns in a given SCEV /// expression. /// /// @param Expr The SCEV expression to scan for SCEVUnknowns. @@ -56,7 +56,7 @@ bool isAffineExpr(const llvm::Region *R, llvm::Loop *Scope, const llvm::SCEV *Expression, llvm::ScalarEvolution &SE, InvariantLoadsSetTy *ILS = nullptr); -/// @brief Check if @p V describes an affine constraint in @p R. +/// Check if @p V describes an affine constraint in @p R. bool isAffineConstraint(llvm::Value *V, const llvm::Region *R, llvm::Loop *Scope, llvm::ScalarEvolution &SE, ParameterSetTy &Params, bool OrExpr = false); @@ -65,7 +65,7 @@ ParameterSetTy getParamsInAffineExpr(const llvm::Region *R, llvm::Loop *Scope, const llvm::SCEV *Expression, llvm::ScalarEvolution &SE); -/// @brief Extract the constant factors from the multiplication @p M. +/// Extract the constant factors from the multiplication @p M. /// /// @param M A potential SCEV multiplication. /// @param SE The ScalarEvolution analysis to create new SCEVs. diff --git a/polly/include/polly/Support/ScopHelper.h b/polly/include/polly/Support/ScopHelper.h index 747eed8507e..c19c2afef22 100644 --- a/polly/include/polly/Support/ScopHelper.h +++ b/polly/include/polly/Support/ScopHelper.h @@ -37,20 +37,20 @@ class GetElementPtrInst; namespace polly { class Scop; -/// @brief Type to remap values. +/// Type to remap values. using ValueMapT = llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>>; -/// @brief Type for a set of invariant loads. +/// Type for a set of invariant loads. using InvariantLoadsSetTy = llvm::SetVector<llvm::AssertingVH<llvm::LoadInst>>; -/// @brief Set type for parameters. +/// Set type for parameters. using ParameterSetTy = llvm::SetVector<const llvm::SCEV *>; -/// @brief Set of loops (used to remember loops in non-affine subregions). +/// Set of loops (used to remember loops in non-affine subregions). using BoxedLoopsSetTy = llvm::SetVector<const llvm::Loop *>; -/// @brief Utility proxy to wrap the common members of LoadInst and StoreInst. +/// Utility proxy to wrap the common members of LoadInst and StoreInst. /// /// This works like the LLVM utility class CallSite, ie. it forwards all calls /// to either a LoadInst, StoreInst, MemIntrinsic or MemTransferInst. @@ -281,7 +281,7 @@ private: } // namespace polly namespace llvm { -/// @brief Specialize simplify_type for MemAccInst to enable dyn_cast and cast +/// Specialize simplify_type for MemAccInst to enable dyn_cast and cast /// from a MemAccInst object. template <> struct simplify_type<polly::MemAccInst> { typedef Instruction *SimpleType; @@ -293,7 +293,7 @@ template <> struct simplify_type<polly::MemAccInst> { namespace polly { -/// @brief Check if the PHINode has any incoming Invoke edge. +/// Check if the PHINode has any incoming Invoke edge. /// /// @param PN The PHINode to check. /// @@ -302,7 +302,7 @@ namespace polly { /// otherwise, return false. bool hasInvokeEdge(const llvm::PHINode *PN); -/// @brief Simplify the region to have a single unconditional entry edge and a +/// Simplify the region to have a single unconditional entry edge and a /// single exit edge. /// /// Although this function allows DT and RI to be null, regions only work @@ -316,7 +316,7 @@ bool hasInvokeEdge(const llvm::PHINode *PN); void simplifyRegion(llvm::Region *R, llvm::DominatorTree *DT, llvm::LoopInfo *LI, llvm::RegionInfo *RI); -/// @brief Split the entry block of a function to store the newly inserted +/// Split the entry block of a function to store the newly inserted /// allocations outside of all Scops. /// /// @param EntryBlock The entry block of the current function. @@ -324,7 +324,7 @@ void simplifyRegion(llvm::Region *R, llvm::DominatorTree *DT, /// void splitEntryBlockForAlloca(llvm::BasicBlock *EntryBlock, llvm::Pass *P); -/// @brief Wrapper for SCEVExpander extended to all Polly features. +/// Wrapper for SCEVExpander extended to all Polly features. /// /// This wrapper will internally call the SCEVExpander but also makes sure that /// all additional features not represented in SCEV (e.g., SDiv/SRem are not @@ -346,7 +346,7 @@ llvm::Value *expandCodeFor(Scop &S, llvm::ScalarEvolution &SE, const llvm::SCEV *E, llvm::Type *Ty, llvm::Instruction *IP, ValueMapT *VMap = nullptr); -/// @brief Check if the block is a error block. +/// Check if the block is a error block. /// /// A error block is currently any block that fullfills at least one of /// the following conditions: @@ -367,7 +367,7 @@ llvm::Value *expandCodeFor(Scop &S, llvm::ScalarEvolution &SE, bool isErrorBlock(llvm::BasicBlock &BB, const llvm::Region &R, llvm::LoopInfo &LI, const llvm::DominatorTree &DT); -/// @brief Return the condition for the terminator @p TI. +/// Return the condition for the terminator @p TI. /// /// For unconditional branches the "i1 true" condition will be returned. /// @@ -376,7 +376,7 @@ bool isErrorBlock(llvm::BasicBlock &BB, const llvm::Region &R, /// @return The condition of @p TI and nullptr if none could be extracted. llvm::Value *getConditionFromTerminator(llvm::TerminatorInst *TI); -/// @brief Check if @p LInst can be hoisted in @p R. +/// Check if @p LInst can be hoisted in @p R. /// /// @param LInst The load to check. /// @param R The analyzed region. @@ -387,11 +387,11 @@ llvm::Value *getConditionFromTerminator(llvm::TerminatorInst *TI); bool isHoistableLoad(llvm::LoadInst *LInst, llvm::Region &R, llvm::LoopInfo &LI, llvm::ScalarEvolution &SE); -/// @brief Return true iff @p V is an intrinsic that we ignore during code +/// Return true iff @p V is an intrinsic that we ignore during code /// generation. bool isIgnoredIntrinsic(const llvm::Value *V); -/// @brief Check whether a value an be synthesized by the code generator. +/// Check whether a value an be synthesized by the code generator. /// /// Some value will be recalculated only from information that is code generated /// from the polyhedral representation. For such instructions we do not need to @@ -409,7 +409,7 @@ bool canSynthesize(const llvm::Value *V, const Scop &S, const llvm::LoopInfo *LI, llvm::ScalarEvolution *SE, llvm::Loop *Scope); -/// @brief Return the block in which a value is used. +/// Return the block in which a value is used. /// /// For normal instructions, this is the instruction's parent block. For PHI /// nodes, this is the incoming block of that use, because this is where the @@ -418,7 +418,7 @@ bool canSynthesize(const llvm::Value *V, const Scop &S, /// case this function returns nullptr. llvm::BasicBlock *getUseBlock(llvm::Use &U); -/// @brief Derive the individual index expressions from a GEP instruction. +/// Derive the individual index expressions from a GEP instruction. /// /// This function optimistically assumes the GEP references into a fixed size /// array. If this is actually true, this function returns a list of array diff --git a/polly/include/polly/Support/ScopLocation.h b/polly/include/polly/Support/ScopLocation.h index 3c15615bf79..50d00116310 100644 --- a/polly/include/polly/Support/ScopLocation.h +++ b/polly/include/polly/Support/ScopLocation.h @@ -22,7 +22,7 @@ class Region; namespace polly { -/// @brief Get the location of a region from the debug info. +/// Get the location of a region from the debug info. /// /// @param R The region to get debug info for. /// @param LineBegin The first line in the region. diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp index 53fee9b021a..dfd970d17d2 100644 --- a/polly/lib/Analysis/DependenceInfo.cpp +++ b/polly/lib/Analysis/DependenceInfo.cpp @@ -87,7 +87,7 @@ static cl::opt<Dependences::AnalyisLevel> OptAnalysisLevel( //===----------------------------------------------------------------------===// -/// @brief Tag the @p Relation domain with @p TagId +/// Tag the @p Relation domain with @p TagId static __isl_give isl_map *tag(__isl_take isl_map *Relation, __isl_take isl_id *TagId) { isl_space *Space = isl_map_get_space(Relation); @@ -98,7 +98,7 @@ static __isl_give isl_map *tag(__isl_take isl_map *Relation, return Relation; } -/// @brief Tag the @p Relation domain with either MA->getArrayId() or +/// Tag the @p Relation domain with either MA->getArrayId() or /// MA->getId() based on @p TagLevel static __isl_give isl_map *tag(__isl_take isl_map *Relation, MemoryAccess *MA, Dependences::AnalyisLevel TagLevel) { @@ -112,7 +112,7 @@ static __isl_give isl_map *tag(__isl_take isl_map *Relation, MemoryAccess *MA, return Relation; } -/// @brief Collect information about the SCoP @p S. +/// Collect information about the SCoP @p S. static void collectInfo(Scop &S, isl_union_map **Read, isl_union_map **Write, isl_union_map **MayWrite, isl_union_map **AccessSchedule, @@ -185,7 +185,7 @@ static void collectInfo(Scop &S, isl_union_map **Read, isl_union_map **Write, *MayWrite = isl_union_map_coalesce(*MayWrite); } -/// @brief Fix all dimension of @p Zero to 0 and add it to @p user +/// Fix all dimension of @p Zero to 0 and add it to @p user static isl_stat fixSetToZero(__isl_take isl_set *Zero, void *user) { isl_union_set **User = (isl_union_set **)user; for (unsigned i = 0; i < isl_set_dim(Zero, isl_dim_set); i++) @@ -194,7 +194,7 @@ static isl_stat fixSetToZero(__isl_take isl_set *Zero, void *user) { return isl_stat_ok; } -/// @brief Compute the privatization dependences for a given dependency @p Map +/// Compute the privatization dependences for a given dependency @p Map /// /// Privatization dependences are widened original dependences which originate /// or end in a reduction access. To compute them we apply the transitive close @@ -780,7 +780,7 @@ bool DependenceInfo::runOnScop(Scop &ScopVar) { return false; } -/// @brief Print the dependences for the given SCoP to @p OS. +/// Print the dependences for the given SCoP to @p OS. void polly::DependenceInfo::printScop(raw_ostream &OS, Scop &S) const { if (auto d = D[OptAnalysisLevel].get()) { diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index eda988d2d6c..586beaf2741 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -178,7 +178,7 @@ static cl::opt<bool, true> XPollyInvariantLoadHoisting( cl::location(PollyInvariantLoadHoisting), cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::cat(PollyCategory)); -/// @brief The minimal trip count under which loops are considered unprofitable. +/// The minimal trip count under which loops are considered unprofitable. static const unsigned MIN_LOOP_TRIP_COUNT = 8; bool polly::PollyTrackFailures = false; @@ -621,7 +621,7 @@ bool ScopDetection::isInvariant(const Value &Val, const Region &Reg) const { return true; } -/// @brief Remove smax of smax(0, size) expressions from a SCEV expression and +/// Remove smax of smax(0, size) expressions from a SCEV expression and /// register the '...' components. /// /// Array access expressions as they are generated by gfortran contain smax(0, @@ -1096,7 +1096,7 @@ bool ScopDetection::isValidLoop(Loop *L, DetectionContext &Context) const { return invalid<ReportLoopBound>(Context, /*Assert=*/true, L, LoopCount); } -/// @brief Return the number of loops in @p L (incl. @p L) that have a trip +/// Return the number of loops in @p L (incl. @p L) that have a trip /// count that is not known to be less than MIN_LOOP_TRIP_COUNT. static int countBeneficialSubLoops(Loop *L, ScalarEvolution &SE) { auto *TripCount = SE.getBackedgeTakenCount(L); @@ -1435,7 +1435,7 @@ void ScopDetection::emitMissedRemarks(const Function &F) { } bool ScopDetection::isReducibleRegion(Region &R, DebugLoc &DbgLoc) const { - /// @brief Enum for coloring BBs in Region. + /// Enum for coloring BBs in Region. /// /// WHITE - Unvisited BB in DFS walk. /// GREY - BBs which are currently on the DFS stack for processing. diff --git a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp index 78b3d9e35e1..e74073cecba 100644 --- a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp +++ b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp @@ -51,7 +51,7 @@ BADSCOP_STAT(Alias, "Found base address alias"); BADSCOP_STAT(Other, "Others"); namespace polly { -/// @brief Small string conversion via raw_string_stream. +/// Small string conversion via raw_string_stream. template <typename T> std::string operator+(Twine LHS, const T &RHS) { std::string Buf; raw_string_ostream fmt(Buf); @@ -63,7 +63,7 @@ template <typename T> std::string operator+(Twine LHS, const T &RHS) { } // namespace polly namespace llvm { -// @brief Lexicographic order on (line, col) of our debug locations. +// Lexicographic order on (line, col) of our debug locations. static bool operator<(const llvm::DebugLoc &LHS, const llvm::DebugLoc &RHS) { return LHS.getLine() < RHS.getLine() || (LHS.getLine() == RHS.getLine() && LHS.getCol() < RHS.getCol()); diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 819bf15a3d6..61edeaf2841 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -461,7 +461,7 @@ MemoryAccess::getReductionOperatorStr(MemoryAccess::ReductionType RT) { return ""; } -/// @brief Return the reduction type for a given binary operator +/// Return the reduction type for a given binary operator. static MemoryAccess::ReductionType getReductionType(const BinaryOperator *BinOp, const Instruction *Load) { if (!BinOp) @@ -747,7 +747,7 @@ __isl_give isl_map *MemoryAccess::foldAccess(__isl_take isl_map *AccessRelation, return AccessRelation; } -/// @brief Check if @p Expr is divisible by @p Size. +/// Check if @p Expr is divisible by @p Size. static bool isDivisible(const SCEV *Expr, unsigned Size, ScalarEvolution &SE) { assert(Size != 0); if (Size == 1) @@ -1114,7 +1114,7 @@ void ScopStmt::realignParams() { Domain = isl_set_gist_params(Domain, Ctx); } -/// @brief Add @p BSet to the set @p User if @p BSet is bounded. +/// Add @p BSet to the set @p User if @p BSet is bounded. static isl_stat collectBoundedParts(__isl_take isl_basic_set *BSet, void *User) { isl_set **BoundedParts = static_cast<isl_set **>(User); @@ -1125,7 +1125,7 @@ static isl_stat collectBoundedParts(__isl_take isl_basic_set *BSet, return isl_stat_ok; } -/// @brief Return the bounded parts of @p S. +/// Return the bounded parts of @p S. static __isl_give isl_set *collectBoundedParts(__isl_take isl_set *S) { isl_set *BoundedParts = isl_set_empty(isl_set_get_space(S)); isl_set_foreach_basic_set(S, collectBoundedParts, &BoundedParts); @@ -1133,7 +1133,7 @@ static __isl_give isl_set *collectBoundedParts(__isl_take isl_set *S) { return BoundedParts; } -/// @brief Compute the (un)bounded parts of @p S wrt. to dimension @p Dim. +/// Compute the (un)bounded parts of @p S wrt. to dimension @p Dim. /// /// @returns A separation of @p S into first an unbounded then a bounded subset, /// both with regards to the dimension @p Dim. @@ -1176,7 +1176,7 @@ partitionSetParts(__isl_take isl_set *S, unsigned Dim) { return std::make_pair(UnboundedParts, BoundedParts); } -/// @brief Set the dimension Ids from @p From in @p To. +/// Set the dimension Ids from @p From in @p To. static __isl_give isl_set *setDimensionIds(__isl_keep isl_set *From, __isl_take isl_set *To) { for (unsigned u = 0, e = isl_set_n_dim(From); u < e; u++) { @@ -1186,7 +1186,7 @@ static __isl_give isl_set *setDimensionIds(__isl_keep isl_set *From, return To; } -/// @brief Create the conditions under which @p L @p Pred @p R is true. +/// Create the conditions under which @p L @p Pred @p R is true. static __isl_give isl_set *buildConditionSet(ICmpInst::Predicate Pred, __isl_take isl_pw_aff *L, __isl_take isl_pw_aff *R) { @@ -1216,7 +1216,7 @@ static __isl_give isl_set *buildConditionSet(ICmpInst::Predicate Pred, } } -/// @brief Create the conditions under which @p L @p Pred @p R is true. +/// Create the conditions under which @p L @p Pred @p R is true. /// /// Helper function that will make sure the dimensions of the result have the /// same isl_id's as the @p Domain. @@ -1228,7 +1228,7 @@ static __isl_give isl_set *buildConditionSet(ICmpInst::Predicate Pred, return setDimensionIds(Domain, ConsequenceCondSet); } -/// @brief Build the conditions sets for the switch @p SI in the @p Domain. +/// Build the conditions sets for the switch @p SI in the @p Domain. /// /// This will fill @p ConditionSets with the conditions under which control /// will be moved from @p SI to its successors. Hence, @p ConditionSets will @@ -1272,8 +1272,8 @@ buildConditionSets(ScopStmt &Stmt, SwitchInst *SI, Loop *L, return true; } -/// @brief Build the conditions sets for the branch condition @p Condition in -/// the @p Domain. +/// Build the conditions sets for the branch condition @p Condition in +/// the @p Domain. /// /// This will fill @p ConditionSets with the conditions under which control /// will be moved from @p TI to its successors. Hence, @p ConditionSets will @@ -1364,7 +1364,7 @@ buildConditionSets(ScopStmt &Stmt, Value *Condition, TerminatorInst *TI, return true; } -/// @brief Build the conditions sets for the terminator @p TI in the @p Domain. +/// Build the conditions sets for the terminator @p TI in the @p Domain. /// /// This will fill @p ConditionSets with the conditions under which control /// will be moved from @p TI to its successors. Hence, @p ConditionSets will @@ -1505,7 +1505,7 @@ void ScopStmt::init(LoopInfo &LI) { checkForReductions(); } -/// @brief Collect loads which might form a reduction chain with @p StoreMA +/// Collect loads which might form a reduction chain with @p StoreMA. /// /// Check if the stored value for @p StoreMA is a binary operator with one or /// two loads as operands. If the binary operand is commutative & associative, @@ -1559,7 +1559,7 @@ void ScopStmt::collectCandiateReductionLoads( Loads.push_back(&getArrayAccessFor(PossibleLoad1)); } -/// @brief Check for reductions in this ScopStmt +/// Check for reductions in this ScopStmt. /// /// Iterate over all store memory accesses and check for valid binary reduction /// like chains. For all candidates we check if they have the same base address @@ -1725,7 +1725,7 @@ void Scop::setContext(__isl_take isl_set *NewContext) { Context = NewContext; } -/// @brief Remap parameter values but keep AddRecs valid wrt. invariant loads. +/// Remap parameter values but keep AddRecs valid wrt. invariant loads. struct SCEVSensitiveParameterRewriter : public SCEVVisitor<SCEVSensitiveParameterRewriter, const SCEV *> { ValueToValueMap &VMap; @@ -2099,7 +2099,7 @@ void Scop::simplifyContexts() { InvalidContext = isl_set_align_params(InvalidContext, getParamSpace()); } -/// @brief Add the minimal/maximal access in @p Set to @p User. +/// Add the minimal/maximal access in @p Set to @p User. static isl_stat buildMinMaxAccess(__isl_take isl_set *Set, void *User) { Scop::MinMaxVectorTy *MinMaxAccesses = (Scop::MinMaxVectorTy *)User; isl_pw_multi_aff *MinPMA, *MaxPMA; @@ -2172,7 +2172,7 @@ static __isl_give isl_set *getAccessDomain(MemoryAccess *MA) { return isl_set_reset_tuple_id(Domain); } -/// @brief Wrapper function to calculate minimal/maximal accesses to each array. +/// Wrapper function to calculate minimal/maximal accesses to each array. static bool calculateMinMaxAccess(__isl_take isl_union_map *Accesses, __isl_take isl_union_set *Domains, Scop::MinMaxVectorTy &MinMaxAccesses) { @@ -2187,17 +2187,17 @@ static bool calculateMinMaxAccess(__isl_take isl_union_map *Accesses, return Valid; } -/// @brief Helper to treat non-affine regions and basic blocks the same. +/// Helper to treat non-affine regions and basic blocks the same. /// ///{ -/// @brief Return the block that is the representing block for @p RN. +/// Return the block that is the representing block for @p RN. static inline BasicBlock *getRegionNodeBasicBlock(RegionNode *RN) { return RN->isSubRegion() ? RN->getNodeAs<Region>()->getEntry() : RN->getNodeAs<BasicBlock>(); } -/// @brief Return the @p idx'th block that is executed after @p RN. +/// Return the @p idx'th block that is executed after @p RN. static inline BasicBlock * getRegionNodeSuccessor(RegionNode *RN, TerminatorInst *TI, unsigned idx) { if (RN->isSubRegion()) { @@ -2207,7 +2207,7 @@ getRegionNodeSuccessor(RegionNode *RN, TerminatorInst *TI, unsigned idx) { return TI->getSuccessor(idx); } -/// @brief Return the smallest loop surrounding @p RN. +/// Return the smallest loop surrounding @p RN. static inline Loop *getRegionNodeLoop(RegionNode *RN, LoopInfo &LI) { if (!RN->isSubRegion()) return LI.getLoopFor(RN->getNodeAs<BasicBlock>()); @@ -2321,7 +2321,7 @@ static Loop *getFirstNonBoxedLoopFor(BasicBlock *BB, LoopInfo &LI, return L; } -/// @brief Adjust the dimensions of @p Dom that was constructed for @p OldL +/// Adjust the dimensions of @p Dom that was constructed for @p OldL /// to be compatible to domains constructed for loop @p NewL. /// /// This function assumes @p NewL and @p OldL are equal or there is a CFG @@ -2735,10 +2735,13 @@ bool Scop::propagateDomainConstraints(Region *R, DominatorTree &DT, return true; } -/// @brief Create a map from SetSpace -> SetSpace where the dimensions @p Dim -/// is incremented by one and all other dimensions are equal, e.g., +/// Create a map to map from a given iteration to a subsequent iteration. +/// +/// This map maps from SetSpace -> SetSpace where the dimensions @p Dim +/// is incremented by one and all other dimensions are equal, e.g., /// [i0, i1, i2, i3] -> [i0, i1, i2 + 1, i3] -/// if @p Dim is 2 and @p SetSpace has 4 dimensions. +/// +/// if @p Dim is 2 and @p SetSpace has 4 dimensions. static __isl_give isl_map * createNextIterationMap(__isl_take isl_space *SetSpace, unsigned Dim) { auto *MapSpace = isl_space_map_from_set(SetSpace); @@ -3076,7 +3079,7 @@ bool Scop::buildAliasGroups(AliasAnalysis &AA) { return true; } -/// @brief Get the smallest loop that contains @p S but is not in @p S. +/// Get the smallest loop that contains @p S but is not in @p S. static Loop *getLoopSurroundingScop(Scop &S, LoopInfo &LI) { // Start with the smallest loop containing the entry and expand that // loop until it contains all blocks in the region. If there is a loop @@ -3285,7 +3288,7 @@ InvariantEquivClassTy *Scop::lookupInvariantEquivClass(Value *Val) { return nullptr; } -/// @brief Check if @p MA can always be hoisted without execution context. +/// Check if @p MA can always be hoisted without execution context. static bool canAlwaysBeHoisted(MemoryAccess *MA, bool StmtInvalidCtxIsEmpty, bool MAInvalidCtxIsEmpty, bool NonHoistableCtxIsEmpty) { @@ -4038,8 +4041,8 @@ struct MapToDimensionDataTy { isl_union_pw_multi_aff *Res; }; -// @brief Create a function that maps the elements of 'Set' to its N-th -// dimension and add it to User->Res. +// Create a function that maps the elements of 'Set' to its N-th dimension and +// add it to User->Res. // // @param Set The input set. // @param User->N The dimension to map to. @@ -4065,8 +4068,8 @@ static isl_stat mapToDimension_AddSet(__isl_take isl_set *Set, void *User) { return isl_stat_ok; } -// @brief Create an isl_multi_union_aff that defines an identity mapping -// from the elements of USet to their N-th dimension. +// Create an isl_multi_union_aff that defines an identity mapping from the +// elements of USet to their N-th dimension. // // # Example: // diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index 9fd1df70807..68b1d830e47 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -53,7 +53,7 @@ public: CodeGeneration() : ScopPass(ID) {} - /// @brief The datalayout used + /// The datalayout used const DataLayout *DL; /// @name The analysis passes we need to generate code. @@ -96,7 +96,7 @@ public: } } - /// @brief Mark a basic block unreachable. + /// Mark a basic block unreachable. /// /// Marks the basic block @p Block unreachable by equipping it with an /// UnreachableInst. @@ -107,7 +107,7 @@ public: OrigTerminator->eraseFromParent(); } - /// @brief Generate LLVM-IR for the SCoP @p S. + /// Generate LLVM-IR for the SCoP @p S. bool runOnScop(Scop &S) override { AI = &getAnalysis<IslAstInfo>(); @@ -198,7 +198,7 @@ public: return true; } - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired<DominatorTreeWrapperPass>(); AU.addRequired<IslAstInfo>(); diff --git a/polly/lib/CodeGen/IRBuilder.cpp b/polly/lib/CodeGen/IRBuilder.cpp index 390de8beb9a..cedbe294291 100644 --- a/polly/lib/CodeGen/IRBuilder.cpp +++ b/polly/lib/CodeGen/IRBuilder.cpp @@ -21,7 +21,7 @@ using namespace llvm; using namespace polly; -/// @brief Get a self referencing id metadata node. +/// Get a self referencing id metadata node. /// /// The MDNode looks like this (if arg0/arg1 are not null): /// diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 01523953fab..4b7cde048f0 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -72,24 +72,24 @@ static cl::opt<bool> DetectParallel("polly-ast-detect-parallel", cl::cat(PollyCategory)); namespace polly { -/// @brief Temporary information used when building the ast. +/// Temporary information used when building the ast. struct AstBuildUserInfo { - /// @brief Construct and initialize the helper struct for AST creation. + /// Construct and initialize the helper struct for AST creation. AstBuildUserInfo() : Deps(nullptr), InParallelFor(false), LastForNodeId(nullptr) {} - /// @brief The dependence information used for the parallelism check. + /// The dependence information used for the parallelism check. const Dependences *Deps; - /// @brief Flag to indicate that we are inside a parallel for node. + /// Flag to indicate that we are inside a parallel for node. bool InParallelFor; - /// @brief The last iterator id created for the current SCoP. + /// The last iterator id created for the current SCoP. isl_id *LastForNodeId; }; } // namespace polly -/// @brief Free an IslAstUserPayload object pointed to by @p Ptr +/// Free an IslAstUserPayload object pointed to by @p Ptr. static void freeIslAstUserPayload(void *Ptr) { delete ((IslAstInfo::IslAstUserPayload *)Ptr); } @@ -99,7 +99,7 @@ IslAstInfo::IslAstUserPayload::~IslAstUserPayload() { isl_pw_aff_free(MinimalDependenceDistance); } -/// @brief Print a string @p str in a single line using @p Printer. +/// Print a string @p str in a single line using @p Printer. static isl_printer *printLine(__isl_take isl_printer *Printer, const std::string &str, __isl_keep isl_pw_aff *PWA = nullptr) { @@ -110,7 +110,7 @@ static isl_printer *printLine(__isl_take isl_printer *Printer, return isl_printer_end_line(Printer); } -/// @brief Return all broken reductions as a string of clauses (OpenMP style). +/// Return all broken reductions as a string of clauses (OpenMP style). static const std::string getBrokenReductionsStr(__isl_keep isl_ast_node *Node) { IslAstInfo::MemoryAccessSet *BrokenReductions; std::string str; @@ -138,7 +138,7 @@ static const std::string getBrokenReductionsStr(__isl_keep isl_ast_node *Node) { return str; } -/// @brief Callback executed for each for node in the ast in order to print it. +/// Callback executed for each for node in the ast in order to print it. static isl_printer *cbPrintFor(__isl_take isl_printer *Printer, __isl_take isl_ast_print_options *Options, __isl_keep isl_ast_node *Node, void *) { @@ -165,7 +165,7 @@ static isl_printer *cbPrintFor(__isl_take isl_printer *Printer, return isl_ast_node_for_print(Node, Printer, Options); } -/// @brief Check if the current scheduling dimension is parallel +/// Check if the current scheduling dimension is parallel. /// /// In case the dimension is parallel we also check if any reduction /// dependences is broken when we exploit this parallelism. If so, @@ -371,7 +371,7 @@ IslAst::buildRunCondition(Scop *S, __isl_keep isl_ast_build *Build) { return RunCondition; } -/// @brief Simple cost analysis for a given SCoP +/// Simple cost analysis for a given SCoP. /// /// TODO: Improve this analysis and extract it to make it usable in other /// places too. diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp index 30f4b0b4b29..730d2c7d2f6 100644 --- a/polly/lib/CodeGen/IslExprBuilder.cpp +++ b/polly/lib/CodeGen/IslExprBuilder.cpp @@ -20,7 +20,7 @@ using namespace llvm; using namespace polly; -/// @brief Different overflow tracking modes. +/// Different overflow tracking modes. enum OverflowTrackingChoice { OT_NEVER, ///< Never tack potential overflows. OT_REQUEST, ///< Track potential overflows if requested. diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index cfd7b53b205..e5cbbb7fee7 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -106,8 +106,8 @@ IslNodeBuilder::getUpperBound(__isl_keep isl_ast_node *For, return UB; } -/// @brief Return true if a return value of Predicate is true for the value -/// represented by passed isl_ast_expr_int. +/// Return true if a return value of Predicate is true for the value represented +/// by passed isl_ast_expr_int. static bool checkIslAstExprInt(__isl_take isl_ast_expr *Expr, isl_bool (*Predicate)(__isl_keep isl_val *)) { if (isl_ast_expr_get_type(Expr) != isl_ast_expr_int) { @@ -128,7 +128,7 @@ int IslNodeBuilder::getNumberOfIterations(__isl_keep isl_ast_node *For) { assert(isl_ast_node_get_type(For) == isl_ast_node_for); auto Body = isl_ast_node_for_get_body(For); - // First, check if we can actually handle this code + // First, check if we can actually handle this code. switch (isl_ast_node_get_type(Body)) { case isl_ast_node_user: break; @@ -177,7 +177,7 @@ int IslNodeBuilder::getNumberOfIterations(__isl_keep isl_ast_node *For) { return NumberIterations + 1; } -/// @brief Extract the values and SCEVs needed to generate code for a block. +/// Extract the values and SCEVs needed to generate code for a block. static int findReferencesInBlock(struct SubtreeReferences &References, const ScopStmt *Stmt, const BasicBlock *BB) { for (const Instruction &Inst : *BB) @@ -487,7 +487,7 @@ void IslNodeBuilder::createForSequential(__isl_take isl_ast_node *For, isl_id_free(IteratorID); } -/// @brief Remove the BBs contained in a (sub)function from the dominator tree. +/// Remove the BBs contained in a (sub)function from the dominator tree. /// /// This function removes the basic blocks that are part of a subfunction from /// the dominator tree. Specifically, when generating code it may happen that at @@ -904,7 +904,7 @@ bool IslNodeBuilder::materializeParameters(isl_set *Set, bool All) { return true; } -/// @brief Add the number of dimensions in @p BS to @p U. +/// Add the number of dimensions in @p BS to @p U. static isl_stat countTotalDims(isl_basic_set *BS, void *U) { unsigned *NumTotalDim = static_cast<unsigned *>(U); *NumTotalDim += isl_basic_set_total_dim(BS); diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp index d090cd5db45..01ebbba7191 100644 --- a/polly/lib/Exchange/JSONExporter.cpp +++ b/polly/lib/Exchange/JSONExporter.cpp @@ -62,13 +62,13 @@ struct JSONExporter : public ScopPass { std::string getFileName(Scop &S) const; Json::Value getJSON(Scop &S) const; - /// @brief Export the SCoP @p S to a JSON file. + /// Export the SCoP @p S to a JSON file. bool runOnScop(Scop &S) override; - /// @brief Print the SCoP @p S as it is exported. + /// Print the SCoP @p S as it is exported. void printScop(raw_ostream &OS, Scop &S) const override; - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; }; @@ -116,13 +116,13 @@ struct JSONImporter : public ScopPass { std::string getFileName(Scop &S) const; - /// @brief Import new access functions for SCoP @p S from a JSON file. + /// Import new access functions for SCoP @p S from a JSON file. bool runOnScop(Scop &S) override; - /// @brief Print the SCoP @p S and the imported access functions. + /// Print the SCoP @p S and the imported access functions. void printScop(raw_ostream &OS, Scop &S) const override; - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; }; } // namespace @@ -469,7 +469,7 @@ bool JSONImporter::importAccesses(Scop &S, Json::Value &JScop, return true; } -/// @brief Check whether @p SAI and @p Array represent the same array. +/// Check whether @p SAI and @p Array represent the same array. bool areArraysEqual(ScopArrayInfo *SAI, Json::Value Array) { std::string Buffer; llvm::raw_string_ostream RawStringOstream(Buffer); @@ -494,7 +494,7 @@ bool areArraysEqual(ScopArrayInfo *SAI, Json::Value Array) { return true; } -/// @brief Get the accepted primitive type from its textual representation +/// Get the accepted primitive type from its textual representation /// @p TypeTextRepresentation. /// /// @param TypeTextRepresentation The textual representation of the type. diff --git a/polly/lib/Polly.cpp b/polly/lib/Polly.cpp index c879fd991a1..95903abdf24 100644 --- a/polly/lib/Polly.cpp +++ b/polly/lib/Polly.cpp @@ -14,7 +14,7 @@ namespace { -/// @brief Initialize Polly passes when library is loaded. +/// Initialize Polly passes when library is loaded. /// /// We use the constructor of a statically declared object to initialize the /// different Polly passes right after the Polly library is loaded. This ensures diff --git a/polly/lib/Support/RegisterPasses.cpp b/polly/lib/Support/RegisterPasses.cpp index 0b8c7a51720..e1261591ba4 100644 --- a/polly/lib/Support/RegisterPasses.cpp +++ b/polly/lib/Support/RegisterPasses.cpp @@ -181,7 +181,7 @@ void initializePollyPasses(PassRegistry &Registry) { initializeCodegenCleanupPass(Registry); } -/// @brief Register Polly passes such that they form a polyhedral optimizer. +/// Register Polly passes such that they form a polyhedral optimizer. /// /// The individual Polly passes are registered in the pass manager such that /// they form a full polyhedral optimizer. The flow of the optimizer starts with @@ -328,7 +328,7 @@ registerPollyScalarOptimizerLatePasses(const llvm::PassManagerBuilder &Builder, PM.add(createCodegenCleanupPass()); } -/// @brief Register Polly to be available as an optimizer +/// Register Polly to be available as an optimizer /// /// /// We can currently run Polly at three different points int the pass manager. diff --git a/polly/lib/Support/SCEVAffinator.cpp b/polly/lib/Support/SCEVAffinator.cpp index cccfaf9ac8a..3f71b3994a1 100644 --- a/polly/lib/Support/SCEVAffinator.cpp +++ b/polly/lib/Support/SCEVAffinator.cpp @@ -42,17 +42,17 @@ static unsigned const MaxZextSmallBitWidth = 7; // The maximal number of bits for which a truncate is modeled precisely. static unsigned const MaxTruncateSmallBitWidth = 31; -/// @brief Return true if a zero-extend from @p Width bits is precisely modeled. +/// Return true if a zero-extend from @p Width bits is precisely modeled. static bool isPreciseZeroExtend(unsigned Width) { return Width <= MaxZextSmallBitWidth; } -/// @brief Return true if a truncate from @p Width bits is precisely modeled. +/// Return true if a truncate from @p Width bits is precisely modeled. static bool isPreciseTruncate(unsigned Width) { return Width <= MaxTruncateSmallBitWidth; } -/// @brief Add the number of basic sets in @p Domain to @p User +/// Add the number of basic sets in @p Domain to @p User static isl_stat addNumBasicSets(isl_set *Domain, isl_aff *Aff, void *User) { auto *NumBasicSets = static_cast<unsigned *>(User); *NumBasicSets += isl_set_n_basic_set(Domain); @@ -61,18 +61,18 @@ static isl_stat addNumBasicSets(isl_set *Domain, isl_aff *Aff, void *User) { return isl_stat_ok; } -/// @brief Helper to free a PWACtx object. +/// Helper to free a PWACtx object. static void freePWACtx(__isl_take PWACtx &PWAC) { isl_pw_aff_free(PWAC.first); isl_set_free(PWAC.second); } -/// @brief Helper to copy a PWACtx object. +/// Helper to copy a PWACtx object. static __isl_give PWACtx copyPWACtx(const __isl_keep PWACtx &PWAC) { return std::make_pair(isl_pw_aff_copy(PWAC.first), isl_set_copy(PWAC.second)); } -/// @brief Determine if @p PWAC is too complex to continue. +/// Determine if @p PWAC is too complex to continue. /// /// Note that @p PWAC will be "free" (deallocated) if this function returns /// true, but not if this function returns false. @@ -85,7 +85,7 @@ static bool isTooComplex(PWACtx &PWAC) { return true; } -/// @brief Return the flag describing the possible wrapping of @p Expr. +/// Return the flag describing the possible wrapping of @p Expr. static SCEV::NoWrapFlags getNoWrapFlags(const SCEV *Expr) { if (auto *NAry = dyn_cast<SCEVNAryExpr>(Expr)) return NAry->getNoWrapFlags(); @@ -98,7 +98,7 @@ static void combine(__isl_keep PWACtx &PWAC0, const __isl_take PWACtx &PWAC1, PWAC0.second = isl_set_union(PWAC0.second, PWAC1.second); } -/// @brief Set the possible wrapping of @p Expr to @p Flags. +/// Set the possible wrapping of @p Expr to @p Flags. static const SCEV *setNoWrapFlags(ScalarEvolution &SE, const SCEV *Expr, SCEV::NoWrapFlags Flags) { auto *NAry = dyn_cast<SCEVNAryExpr>(Expr); diff --git a/polly/lib/Support/SCEVValidator.cpp b/polly/lib/Support/SCEVValidator.cpp index 7d35d9e950d..82e8fd6ed7f 100644 --- a/polly/lib/Support/SCEVValidator.cpp +++ b/polly/lib/Support/SCEVValidator.cpp @@ -12,7 +12,7 @@ using namespace polly; #define DEBUG_TYPE "polly-scev-validator" namespace SCEVType { -/// @brief The type of a SCEV +/// The type of a SCEV /// /// To check for the validity of a SCEV we assign to each SCEV a type. The /// possible types are INT, PARAM, IV and INVALID. The order of the types is @@ -34,58 +34,58 @@ enum TYPE { }; } // namespace SCEVType -/// @brief The result the validator returns for a SCEV expression. +/// The result the validator returns for a SCEV expression. class ValidatorResult { - /// @brief The type of the expression + /// The type of the expression SCEVType::TYPE Type; - /// @brief The set of Parameters in the expression. + /// The set of Parameters in the expression. ParameterSetTy Parameters; public: - /// @brief The copy constructor + /// The copy constructor ValidatorResult(const ValidatorResult &Source) { Type = Source.Type; Parameters = Source.Parameters; } - /// @brief Construct a result with a certain type and no parameters. + /// Construct a result with a certain type and no parameters. ValidatorResult(SCEVType::TYPE Type) : Type(Type) { assert(Type != SCEVType::PARAM && "Did you forget to pass the parameter"); } - /// @brief Construct a result with a certain type and a single parameter. + /// Construct a result with a certain type and a single parameter. ValidatorResult(SCEVType::TYPE Type, const SCEV *Expr) : Type(Type) { Parameters.insert(Expr); } - /// @brief Get the type of the ValidatorResult. + /// Get the type of the ValidatorResult. SCEVType::TYPE getType() { return Type; } - /// @brief Is the analyzed SCEV constant during the execution of the SCoP. + /// Is the analyzed SCEV constant during the execution of the SCoP. bool isConstant() { return Type == SCEVType::INT || Type == SCEVType::PARAM; } - /// @brief Is the analyzed SCEV valid. + /// Is the analyzed SCEV valid. bool isValid() { return Type != SCEVType::INVALID; } - /// @brief Is the analyzed SCEV of Type IV. + /// Is the analyzed SCEV of Type IV. bool isIV() { return Type == SCEVType::IV; } - /// @brief Is the analyzed SCEV of Type INT. + /// Is the analyzed SCEV of Type INT. bool isINT() { return Type == SCEVType::INT; } - /// @brief Is the analyzed SCEV of Type PARAM. + /// Is the analyzed SCEV of Type PARAM. bool isPARAM() { return Type == SCEVType::PARAM; } - /// @brief Get the parameters of this validator result. + /// Get the parameters of this validator result. const ParameterSetTy &getParameters() { return Parameters; } - /// @brief Add the parameters of Source to this result. + /// Add the parameters of Source to this result. void addParamsFrom(const ValidatorResult &Source) { Parameters.insert(Source.Parameters.begin(), Source.Parameters.end()); } - /// @brief Merge a result. + /// Merge a result. /// /// This means to merge the parameters and to set the Type to the most /// specific Type that matches both. @@ -387,7 +387,7 @@ public: } }; -/// @brief Check whether a SCEV refers to an SSA name defined inside a region. +/// Check whether a SCEV refers to an SSA name defined inside a region. class SCEVInRegionDependences { const Region *R; Loop *Scope; diff --git a/polly/lib/Transform/CodePreparation.cpp b/polly/lib/Transform/CodePreparation.cpp index 0fab4bf6068..11e940f3679 100644 --- a/polly/lib/Transform/CodePreparation.cpp +++ b/polly/lib/Transform/CodePreparation.cpp @@ -30,7 +30,7 @@ using namespace polly; namespace { -/// @brief Prepare the IR for the scop detection. +/// Prepare the IR for the scop detection. /// class CodePreparation : public FunctionPass { CodePreparation(const CodePreparation &) = delete; diff --git a/polly/lib/Transform/DeadCodeElimination.cpp b/polly/lib/Transform/DeadCodeElimination.cpp index 5bf5c0fb146..b52d1597739 100644 --- a/polly/lib/Transform/DeadCodeElimination.cpp +++ b/polly/lib/Transform/DeadCodeElimination.cpp @@ -59,14 +59,14 @@ public: static char ID; explicit DeadCodeElim() : ScopPass(ID) {} - /// @brief Remove dead iterations from the schedule of @p S. + /// Remove dead iterations from the schedule of @p S. bool runOnScop(Scop &S) override; - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; private: - /// @brief Return the set of live iterations. + /// Return the set of live iterations. /// /// The set of live iterations are all iterations that write to memory and for /// which we can not prove that there will be a later write that _must_ diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp index 93f6d9e6d0c..c8258922334 100644 --- a/polly/lib/Transform/ScheduleOptimizer.cpp +++ b/polly/lib/Transform/ScheduleOptimizer.cpp @@ -204,8 +204,8 @@ static cl::opt<bool> OptimizedScops( "transformations is applied on the schedule tree"), cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); -/// @brief Create an isl_union_set, which describes the isolate option based -/// on IsoalteDomain. +/// Create an isl_union_set, which describes the isolate option based on +/// IsoalteDomain. /// /// @param IsolateDomain An isl_set whose last dimension is the only one that /// should belong to the current band node. @@ -220,8 +220,8 @@ getIsolateOptions(__isl_take isl_set *IsolateDomain) { return isl_union_set_from_set(isl_set_set_tuple_id(IsolateOption, Id)); } -/// @brief Create an isl_union_set, which describes the atomic option for the -/// dimension of the current node. +/// Create an isl_union_set, which describes the atomic option for the dimension +/// of the current node. /// /// It may help to reduce the size of generated code. /// @@ -233,8 +233,7 @@ static __isl_give isl_union_set *getAtomicOptions(__isl_take isl_ctx *Ctx) { return isl_union_set_from_set(isl_set_set_tuple_id(AtomicOption, Id)); } -/// @brief Make the last dimension of Set to take values -/// from 0 to VectorWidth - 1. +/// Make the last dimension of Set to take values from 0 to VectorWidth - 1. /// /// @param Set A set, which should be modified. /// @param VectorWidth A parameter, which determines the constraint. @@ -256,7 +255,7 @@ static __isl_give isl_set *addExtentConstraints(__isl_take isl_set *Set, return isl_set_add_constraint(Set, ExtConstr); } -/// @brief Build the desired set of partial tile prefixes. +/// Build the desired set of partial tile prefixes. /// /// We build a set of partial tile prefixes, which are prefixes of the vector /// loop that have exactly VectorWidth iterations. @@ -438,8 +437,8 @@ ScheduleTreeOptimizer::standardBandOpts(__isl_take isl_schedule_node *Node, return Node; } -/// @brief Check whether output dimensions of the map rely on the specified -/// input dimension. +/// Check whether output dimensions of the map rely on the specified input +/// dimension. /// /// @param IslMap The isl map to be considered. /// @param DimNum The number of an input dimension to be checked. @@ -460,8 +459,8 @@ static bool isInputDimUsed(__isl_take isl_map *IslMap, unsigned DimNum) { return res; } -/// @brief Check if the SCoP statement could probably be optimized with -/// analytical modeling. +/// Check if the SCoP statement could probably be optimized with analytical +/// modeling. /// /// containsMatrMult tries to determine whether the following conditions /// are true: @@ -498,7 +497,7 @@ static bool containsMatrMult(__isl_keep isl_map *PartialSchedule) { return !isInputDimUsed((*MemA)->getAccessRelation(), DimNum - 1); } -/// @brief Circular shift of output dimensions of the integer map. +/// Circular shift of output dimensions of the integer map. /// /// @param IslMap The isl map to be modified. static __isl_give isl_map *circularShiftOutputDims(__isl_take isl_map *IslMap) { @@ -511,7 +510,7 @@ static __isl_give isl_map *circularShiftOutputDims(__isl_take isl_map *IslMap) { return isl_map_set_tuple_id(IslMap, isl_dim_in, InputDimsId); } -/// @brief Permute two dimensions of the band node. +/// Permute two dimensions of the band node. /// /// Permute FirstDim and SecondDim dimensions of the Node. /// @@ -625,8 +624,7 @@ getMacroKernelParams(const MicroKernelParamsTy &MicroKernelParams) { return {Mc, Nc, Kc}; } -/// @brief Identify a memory access through the shape of its memory access -/// relation. +/// Identify a memory access through the shape of its memory access relation. /// /// Identify the unique memory access in @p Stmt, that has an access relation /// equal to @p ExpectedAccessRelation. @@ -662,7 +660,7 @@ identifyAccessByAccessRelation(ScopStmt *Stmt, return IdentifiedAccess; } -/// @brief Create an access relation that is specific to the matrix +/// Create an access relation that is specific to the matrix /// multiplication pattern. /// /// Create an access relation of the following form: @@ -685,8 +683,8 @@ getMatMulPatternOriginalAccessRelation(ScopStmt *Stmt, unsigned I, unsigned J) { return AccessRel; } -/// @brief Identify the memory access that corresponds to the access -/// to the second operand of the matrix multiplication. +/// Identify the memory access that corresponds to the access to the second +/// operand of the matrix multiplication. /// /// Identify the memory access that corresponds to the access /// to the matrix B of the matrix multiplication C = A x B. @@ -700,8 +698,8 @@ MemoryAccess *identifyAccessA(ScopStmt *Stmt) { return identifyAccessByAccessRelation(Stmt, OriginalRel); } -/// @brief Identify the memory access that corresponds to the access -/// to the first operand of the matrix multiplication. +/// Identify the memory access that corresponds to the access to the first +/// operand of the matrix multiplication. /// /// Identify the memory access that corresponds to the access /// to the matrix A of the matrix multiplication C = A x B. @@ -715,7 +713,7 @@ MemoryAccess *identifyAccessB(ScopStmt *Stmt) { return identifyAccessByAccessRelation(Stmt, OriginalRel); } -/// @brief Create an access relation that is specific to +/// Create an access relation that is specific to /// the matrix multiplication pattern. /// /// Create an access relation of the following form: @@ -761,7 +759,7 @@ __isl_give isl_map *getMatMulAccRel(__isl_take isl_map *MapOldIndVar, return isl_map_apply_range(MapOldIndVar, AccessRel); } -/// @brief Apply the packing transformation. +/// Apply the packing transformation. /// /// The packing transformation can be described as a data-layout /// transformation that requires to introduce a new array, copy data @@ -804,8 +802,8 @@ static void optimizeDataLayoutMatrMulPattern(__isl_take isl_map *MapOldIndVar, MemAccessB->setNewAccessRelation(AccRel); } -/// @brief Get a relation mapping induction variables produced by schedule -/// transformations to the original ones. +/// Get a relation mapping induction variables produced by schedule +/// transformations to the original ones. /// /// @param Node The schedule node produced as the result of creation /// of the BLIS kernels. @@ -928,16 +926,16 @@ public: ~IslScheduleOptimizer() { isl_schedule_free(LastSchedule); } - /// @brief Optimize the schedule of the SCoP @p S. + /// Optimize the schedule of the SCoP @p S. bool runOnScop(Scop &S) override; - /// @brief Print the new schedule for the SCoP @p S. + /// Print the new schedule for the SCoP @p S. void printScop(raw_ostream &OS, Scop &S) const override; - /// @brief Register all analyses and transformation required. + /// Register all analyses and transformation required. void getAnalysisUsage(AnalysisUsage &AU) const override; - /// @brief Release the internal memory. + /// Release the internal memory. void releaseMemory() override { isl_schedule_free(LastSchedule); LastSchedule = nullptr; |