From f3d122cd02728afd3a2f27f2cc60d434982164d2 Mon Sep 17 00:00:00 2001 From: Piotr Padlewski Date: Fri, 30 Sep 2016 21:05:49 +0000 Subject: [PATCH] NFC fix doxygen comments llvm-svn: 282950 --- llvm/include/llvm/Analysis/InlineCost.h | 6 +++--- llvm/include/llvm/IR/Function.h | 25 ++++++++++++++-------- llvm/lib/Analysis/InlineCost.cpp | 36 ++++++++++++++++---------------- llvm/lib/Analysis/ProfileSummaryInfo.cpp | 14 ++++++------- 4 files changed, 44 insertions(+), 37 deletions(-) diff --git a/llvm/include/llvm/Analysis/InlineCost.h b/llvm/include/llvm/Analysis/InlineCost.h index 50e4448..10f1811 100644 --- a/llvm/include/llvm/Analysis/InlineCost.h +++ b/llvm/include/llvm/Analysis/InlineCost.h @@ -29,13 +29,13 @@ class TargetTransformInfo; namespace InlineConstants { // Various thresholds used by inline cost analysis. -// Use when optsize (-Os) is specified. +/// Use when optsize (-Os) is specified. const int OptSizeThreshold = 75; -// Use when minsize (-Oz) is specified. +/// Use when minsize (-Oz) is specified. const int OptMinSizeThreshold = 25; -// Use when -O3 is specified. +/// Use when -O3 is specified. const int OptAggressiveThreshold = 275; // Various magic constants used to adjust heuristics. diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h index 44ac826..d390e29 100644 --- a/llvm/include/llvm/IR/Function.h +++ b/llvm/include/llvm/IR/Function.h @@ -110,11 +110,12 @@ public: ~Function() override; - /// \brief Provide fast operand accessors + // Provide fast operand accessors. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); - - Type *getReturnType() const; // Return the type of the ret val - FunctionType *getFunctionType() const; // Return the FunctionType for me + /// Returns the type of the ret val. + Type *getReturnType() const; + /// Returns the FunctionType for me. + FunctionType *getFunctionType() const; /// getContext - Return a reference to the LLVMContext associated with this /// function. @@ -190,10 +191,16 @@ public: getContext(), AttributeSet::FunctionIndex, Kind)); } - /// Set the entry count for this function. + /// \brief Set the entry count for this function. + /// + /// Entry count is the number of times this function was executed based on + /// pgo data. void setEntryCount(uint64_t Count); - /// Get the entry count for this function. + /// \brief Get the entry count for this function. + /// + /// Entry count is the number of times the function was executed based on + /// pgo data. Optional getEntryCount() const; /// @brief Return true if the function has the attribute. @@ -324,7 +331,7 @@ public: } /// @brief Determine if the function may only access memory that is - // either inaccessible from the IR or pointed to by its arguments. + /// either inaccessible from the IR or pointed to by its arguments. bool onlyAccessesInaccessibleMemOrArgMem() const { return hasFnAttribute(Attribute::InaccessibleMemOrArgMemOnly); } @@ -647,8 +654,8 @@ private: void allocHungoffUselist(); template void setHungoffOperand(Constant *C); - // Shadow Value::setValueSubclassData with a private forwarding method so that - // subclasses cannot accidentally use it. + /// Shadow Value::setValueSubclassData with a private forwarding method so + /// that subclasses cannot accidentally use it. void setValueSubclassData(unsigned short D) { Value::setValueSubclassData(D); } diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 22d291b..a9d628d 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -75,15 +75,15 @@ class CallAnalyzer : public InstVisitor { /// Profile summary information. ProfileSummaryInfo *PSI; - // The called function. + /// The called function. Function &F; - // The candidate callsite being analyzed. Please do not use this to do - // analysis in the caller function; we want the inline cost query to be - // easily cacheable. Instead, use the cover function paramHasAttr. + /// The candidate callsite being analyzed. Please do not use this to do + /// analysis in the caller function; we want the inline cost query to be + /// easily cacheable. Instead, use the cover function paramHasAttr. CallSite CandidateCS; - // Tunable parameters that control the analysis. + /// Tunable parameters that control the analysis. const InlineParams &Params; int Threshold; @@ -104,25 +104,25 @@ class CallAnalyzer : public InstVisitor { int FiftyPercentVectorBonus, TenPercentVectorBonus; int VectorBonus; - // While we walk the potentially-inlined instructions, we build up and - // maintain a mapping of simplified values specific to this callsite. The - // idea is to propagate any special information we have about arguments to - // this call through the inlinable section of the function, and account for - // likely simplifications post-inlining. The most important aspect we track - // is CFG altering simplifications -- when we prove a basic block dead, that - // can cause dramatic shifts in the cost of inlining a function. + /// While we walk the potentially-inlined instructions, we build up and + /// maintain a mapping of simplified values specific to this callsite. The + /// idea is to propagate any special information we have about arguments to + /// this call through the inlinable section of the function, and account for + /// likely simplifications post-inlining. The most important aspect we track + /// is CFG altering simplifications -- when we prove a basic block dead, that + /// can cause dramatic shifts in the cost of inlining a function. DenseMap SimplifiedValues; - // Keep track of the values which map back (through function arguments) to - // allocas on the caller stack which could be simplified through SROA. + /// Keep track of the values which map back (through function arguments) to + /// allocas on the caller stack which could be simplified through SROA. DenseMap SROAArgValues; - // The mapping of caller Alloca values to their accumulated cost savings. If - // we have to disable SROA for one of the allocas, this tells us how much - // cost must be added. + /// The mapping of caller Alloca values to their accumulated cost savings. If + /// we have to disable SROA for one of the allocas, this tells us how much + /// cost must be added. DenseMap SROAArgCosts; - // Keep track of values which map to a pointer base and constant offset. + /// Keep track of values which map to a pointer base and constant offset. DenseMap> ConstantOffsetPtrs; // Custom simplification helper routines. diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp index df1414d..5285b7f 100644 --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -63,9 +63,9 @@ void ProfileSummaryInfo::computeSummary() { Summary.reset(ProfileSummary::getFromMD(SummaryMD)); } -// Returns true if the function is a hot function. If it returns false, it -// either means it is not hot or it is unknown whether F is hot or not (for -// example, no profile data is available). +/// Returns true if the function is a hot function. If it returns false, it +/// either means it is not hot or it is unknown whether F is hot or not (for +/// example, no profile data is available). bool ProfileSummaryInfo::isHotFunction(const Function *F) { computeSummary(); if (!F || !Summary) @@ -79,9 +79,9 @@ bool ProfileSummaryInfo::isHotFunction(const Function *F) { (uint64_t)(0.3 * (double)Summary->getMaxFunctionCount())); } -// Returns true if the function is a cold function. If it returns false, it -// either means it is not cold or it is unknown whether F is cold or not (for -// example, no profile data is available). +/// Returns true if the function is a cold function. If it returns false, it +/// either means it is not cold or it is unknown whether F is cold or not (for +/// example, no profile data is available). bool ProfileSummaryInfo::isColdFunction(const Function *F) { computeSummary(); if (!F) @@ -100,7 +100,7 @@ bool ProfileSummaryInfo::isColdFunction(const Function *F) { (uint64_t)(0.01 * (double)Summary->getMaxFunctionCount())); } -// Compute the hot and cold thresholds. +/// Compute the hot and cold thresholds. void ProfileSummaryInfo::computeThresholds() { if (!Summary) computeSummary(); -- 2.7.4