|
LLVM
10.0.0
|
#include "llvm/Transforms/IPO/SampleProfile.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/None.h"#include "llvm/ADT/SCCIterator.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringMap.h"#include "llvm/ADT/StringRef.h"#include "llvm/ADT/Twine.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/CallGraph.h"#include "llvm/Analysis/CallGraphSCCPass.h"#include "llvm/Analysis/InlineCost.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/OptimizationRemarkEmitter.h"#include "llvm/Analysis/PostDominators.h"#include "llvm/Analysis/ProfileSummaryInfo.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/CFG.h"#include "llvm/IR/CallSite.h"#include "llvm/IR/DebugInfoMetadata.h"#include "llvm/IR/DebugLoc.h"#include "llvm/IR/DiagnosticInfo.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Module.h"#include "llvm/IR/PassManager.h"#include "llvm/IR/ValueSymbolTable.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/ProfileData/InstrProf.h"#include "llvm/ProfileData/SampleProf.h"#include "llvm/ProfileData/SampleProfReader.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/ErrorOr.h"#include "llvm/Support/GenericDomTree.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/IPO.h"#include "llvm/Transforms/Instrumentation.h"#include "llvm/Transforms/Utils/CallPromotionUtils.h"#include "llvm/Transforms/Utils/Cloning.h"#include "llvm/Transforms/Utils/MisExpect.h"#include <algorithm>#include <cassert>#include <cstdint>#include <functional>#include <limits>#include <map>#include <memory>#include <queue>#include <string>#include <system_error>#include <utility>#include <vector>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "sample-profile" |
| #define | CSINLINE_DEBUG DEBUG_TYPE "-inline" |
Typedefs | |
| using | ProfileCount = Function::ProfileCount |
Functions | |
| STATISTIC (NumCSInlined, "Number of functions inlined with context sensitive profile") | |
| STATISTIC (NumCSNotInlined, "Number of functions not inlined with context sensitive profile") | |
| static SmallVector< InstrProfValueData, 2 > | GetSortedValueDataFromCallTargets (const SampleRecord::CallTargetMap &M) |
Returns the sorted CallTargetMap M by count in descending order. More... | |
| INITIALIZE_PASS_BEGIN (SampleProfileLoaderLegacyPass, "sample-profile", "Sample Profile loader", false, false) INITIALIZE_PASS_END(SampleProfileLoaderLegacyPass | |
Variables | |
| static cl::opt< std::string > | SampleProfileFile ("sample-profile-file", cl::init(""), cl::value_desc("filename"), cl::desc("Profile file loaded by -sample-profile"), cl::Hidden) |
| static cl::opt< std::string > | SampleProfileRemappingFile ("sample-profile-remapping-file", cl::init(""), cl::value_desc("filename"), cl::desc("Profile remapping file loaded by -sample-profile"), cl::Hidden) |
| static cl::opt< unsigned > | SampleProfileMaxPropagateIterations ("sample-profile-max-propagate-iterations", cl::init(100), cl::desc("Maximum number of iterations to go through when propagating " "sample block/edge weights through the CFG.")) |
| static cl::opt< unsigned > | SampleProfileRecordCoverage ("sample-profile-check-record-coverage", cl::init(0), cl::value_desc("N"), cl::desc("Emit a warning if less than N% of records in the input profile " "are matched to the IR.")) |
| static cl::opt< unsigned > | SampleProfileSampleCoverage ("sample-profile-check-sample-coverage", cl::init(0), cl::value_desc("N"), cl::desc("Emit a warning if less than N% of samples in the input profile " "are matched to the IR.")) |
| static cl::opt< bool > | NoWarnSampleUnused ("no-warn-sample-unused", cl::init(false), cl::Hidden, cl::desc("Use this option to turn off/on warnings about function with " "samples but without debug information to use those samples. ")) |
| static cl::opt< bool > | ProfileSampleAccurate ("profile-sample-accurate", cl::Hidden, cl::init(false), cl::desc("If the sample profile is accurate, we will mark all un-sampled " "callsite and function as having 0 samples. Otherwise, treat " "un-sampled callsites and functions conservatively as unknown. ")) |
| static cl::opt< bool > | ProfileAccurateForSymsInList ("profile-accurate-for-symsinlist", cl::Hidden, cl::ZeroOrMore, cl::init(true), cl::desc("For symbols in profile symbol list, regard their profiles to " "be accurate. It may be overriden by profile-sample-accurate. ")) |
| static cl::opt< bool > | ProfileMergeInlinee ("sample-profile-merge-inlinee", cl::Hidden, cl::init(false), cl::desc("Merge past inlinee's profile to outline version if sample " "profile loader decided not to inline a call site.")) |
| static cl::opt< bool > | ProfileTopDownLoad ("sample-profile-top-down-load", cl::Hidden, cl::init(false), cl::desc("Do profile annotation and inlining for functions in top-down " "order of call graph during sample profile loading.")) |
| static cl::opt< bool > | ProfileSizeInline ("sample-profile-inline-size", cl::Hidden, cl::init(false), cl::desc("Inline cold call sites in profile loader if it's beneficial " "for code size.")) |
| static cl::opt< int > | SampleColdCallSiteThreshold ("sample-profile-cold-inline-threshold", cl::Hidden, cl::init(45), cl::desc("Threshold for inlining cold callsites")) |
| sample | profile |
| sample Sample Profile | loader |
| sample Sample Profile | false |
| #define CSINLINE_DEBUG DEBUG_TYPE "-inline" |
Definition at line 98 of file SampleProfile.cpp.
| #define DEBUG_TYPE "sample-profile" |
Definition at line 97 of file SampleProfile.cpp.
Referenced by GetSortedValueDataFromCallTargets().
| using ProfileCount = Function::ProfileCount |
Definition at line 96 of file SampleProfile.cpp.
|
static |
Returns the sorted CallTargetMap M by count in descending order.
Definition at line 1444 of file SampleProfile.cpp.
References llvm::annotateValueSite(), llvm::MDBuilder::createBranchWeights(), llvm::dbgs(), DEBUG_TYPE, llvm::LLVMContext::diagnose(), llvm::DS_Warning, E, llvm::SmallVectorImpl< T >::emplace_back(), llvm::Instruction::extractProfTotalWeight(), llvm::sampleprof::FunctionSamples::findCallTargetMapAt(), llvm::DILocation::getBaseDiscriminator(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getCalledFunction(), llvm::Function::getContext(), llvm::Value::getContext(), llvm::Instruction::getDebugLoc(), llvm::DIScope::getFilename(), llvm::BasicBlock::getFirstNonPHIOrDbgOrLifetime(), llvm::sampleprof::FunctionSamples::getGUID(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::DebugLoc::getLine(), llvm::Value::getName(), llvm::Instruction::getNumSuccessors(), llvm::sampleprof::FunctionSamples::getOffset(), llvm::Function::getSubprogram(), llvm::Instruction::getSuccessor(), I, INITIALIZE_PASS_BEGIN(), INITIALIZE_PASS_DEPENDENCY, LLVM_DEBUG, llvm::max(), NoWarnSampleUnused, llvm::Function::PCT_Real, llvm::SmallVectorTemplateBase< T, bool >::push_back(), SampleProfileMaxPropagateIterations, SampleProfileRecordCoverage, SampleProfileSampleCoverage, llvm::Function::setEntryCount(), llvm::Instruction::setMetadata(), llvm::SmallVectorBase::size(), llvm::sampleprof::SampleRecord::SortCallTargets(), and llvm::misexpect::verifyMisExpect().
| INITIALIZE_PASS_BEGIN | ( | SampleProfileLoaderLegacyPass | , |
| "sample-profile" | , | ||
| "Sample Profile loader" | , | ||
| false | , | ||
| false | |||
| ) |
Referenced by GetSortedValueDataFromCallTargets().
| sample Sample Profile false |
Definition at line 1774 of file SampleProfile.cpp.
| sample Sample Profile loader |
Definition at line 1774 of file SampleProfile.cpp.
|
static |
Referenced by GetSortedValueDataFromCallTargets().
| sample profile |
Definition at line 1774 of file SampleProfile.cpp.
|
static |
Referenced by llvm::createSampleProfileLoaderPass().
|
static |
|
static |
Referenced by llvm::createSampleProfileLoaderPass().
|
static |
|
static |
|
static |
|
static |
Referenced by llvm::SampleProfileLoaderPass::run().
|
static |
Referenced by GetSortedValueDataFromCallTargets().
|
static |
Referenced by GetSortedValueDataFromCallTargets().
|
static |
Referenced by llvm::SampleProfileLoaderPass::run().
|
static |
Referenced by GetSortedValueDataFromCallTargets().
1.8.13