summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp36
-rw-r--r--llvm/lib/Analysis/ProfileSummaryInfo.cpp14
2 files changed, 25 insertions, 25 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 22d291b14c7..a9d628dafbe 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -75,15 +75,15 @@ class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> {
/// 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<CallAnalyzer, bool> {
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<Value *, Constant *> 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<Value *, Value *> 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<Value *, int> 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<Value *, std::pair<Value *, APInt>> ConstantOffsetPtrs;
// Custom simplification helper routines.
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index df1414d6811..5285b7fb9d0 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();
OpenPOWER on IntegriCloud