LLVM
8.0.1
|
#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/IndirectCallPromotionAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/TypeMetadataUtils.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/Object/ModuleSymbolTable.h"
#include "llvm/Object/SymbolicFile.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <vector>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "module-summary-analysis" |
Variables | |
FunctionSummary::ForceSummaryHotnessType | ForceSummaryEdgesCold |
cl::opt< FunctionSummary::ForceSummaryHotnessType, true > | FSEC ("force-summary-edges-cold", cl::Hidden, cl::location(ForceSummaryEdgesCold), cl::desc("Force all edges in the function summary to cold"), cl::values(clEnumValN(FunctionSummary::FSHT_None, "none", "None."), clEnumValN(FunctionSummary::FSHT_AllNonCritical, "all-non-critical", "All non-critical edges."), clEnumValN(FunctionSummary::FSHT_All, "all", "All edges."))) |
module summary | analysis |
module summary Module Summary | Analysis |
module summary Module Summary | false |
#define DEBUG_TYPE "module-summary-analysis" |
Definition at line 60 of file ModuleSummaryAnalysis.cpp.
|
static |
If this intrinsic call requires that we add information to the function summary, do so via the non-constant reference arguments.
Definition at line 156 of file ModuleSummaryAnalysis.cpp.
References addVCallToSet(), llvm::any_of(), llvm::Intrinsic::assume, llvm::dyn_cast(), F(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::GlobalValue::getGUID(), llvm::Function::getIntrinsicID(), llvm::SetVector< T, Vector, Set >::insert(), llvm::Intrinsic::type_checked_load, llvm::Intrinsic::type_test, and llvm::Value::uses().
Referenced by computeFunctionSummary().
|
static |
Determine whether this call has all constant integer arguments (excluding "this") and summarize it to VCalls or ConstVCalls as appropriate.
Definition at line 138 of file ModuleSummaryAnalysis.cpp.
References Arg, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::DevirtCallSite::CS, llvm::dyn_cast(), llvm::SetVector< T, Vector, Set >::insert(), llvm::make_range(), and llvm::DevirtCallSite::Offset.
Referenced by addIntrinsicToSummary().
|
static |
Definition at line 433 of file ModuleSummaryAnalysis.cpp.
References llvm::ModuleSummaryIndex::addGlobalValueSummary(), assert(), llvm::GlobalIndirectSymbol::getBaseObject(), llvm::ModuleSummaryIndex::getGlobalValueSummary(), llvm::GlobalValue::getGUID(), llvm::GlobalValue::getLinkage(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::GlobalValue::isDSOLocal(), and isNonRenamableLocal().
Referenced by llvm::buildModuleSummaryIndex().
|
static |
Definition at line 230 of file ModuleSummaryAnalysis.cpp.
References llvm::ModuleSummaryIndex::addGlobalValueSummary(), addIntrinsicToSummary(), assert(), Callee, llvm::CalleeInfo::Cold, llvm::CalleeInfo::Critical, llvm::dyn_cast(), llvm::SmallPtrSetImpl< PtrType >::erase(), findRefEdges(), ForceSummaryEdgesCold, llvm::FunctionSummary::FSHT_All, llvm::FunctionSummary::FSHT_None, llvm::BlockFrequencyInfo::getBlockFreq(), llvm::BlockFrequencyInfo::getEntryFreq(), llvm::BlockFrequency::getFrequency(), getHotness(), llvm::ModuleSummaryIndex::getOrInsertValueInfo(), llvm::ProfileSummaryInfo::getProfileCount(), llvm::ICallPromotionAnalysis::getPromotionCandidatesForInstruction(), llvm::Value::hasName(), I, llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), isNonRenamableLocal(), isNonVolatileLoad(), llvm::LLVMContext::MD_callees, llvm::Attribute::NoInline, llvm::Attribute::NoRecurse, llvm::Attribute::ReadNone, llvm::Attribute::ReadOnly, llvm::SetVector< T, Vector, Set >::size(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::takeVector(), llvm::SetVector< T, Vector, Set >::takeVector(), and llvm::CalleeInfo::Unknown.
Referenced by llvm::buildModuleSummaryIndex().
|
static |
Definition at line 410 of file ModuleSummaryAnalysis.cpp.
References llvm::ModuleSummaryIndex::addGlobalValueSummary(), findRefEdges(), llvm::GlobalValue::getGUID(), llvm::GlobalValue::getLinkage(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalObject::hasComdat(), llvm::GlobalValue::hasDLLExportStorageClass(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::GlobalValue::isDSOLocal(), llvm::GlobalValue::isInterposable(), isNonRenamableLocal(), and llvm::SetVector< T, Vector, Set >::takeVector().
Referenced by llvm::buildModuleSummaryIndex().
|
static |
Definition at line 84 of file ModuleSummaryAnalysis.cpp.
References llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::ModuleSummaryIndex::getOrInsertValueInfo(), llvm::SetVector< T, Vector, Set >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isCallee(), llvm::User::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by computeFunctionSummary(), and computeVariableSummary().
|
static |
Definition at line 121 of file ModuleSummaryAnalysis.cpp.
References llvm::CalleeInfo::Cold, llvm::CalleeInfo::Hot, llvm::ProfileSummaryInfo::isColdCount(), llvm::ProfileSummaryInfo::isHotCount(), llvm::CalleeInfo::None, and llvm::CalleeInfo::Unknown.
Referenced by computeFunctionSummary().
INITIALIZE_PASS_BEGIN | ( | ModuleSummaryIndexWrapperPass | , |
"module-summary-analysis" | , | ||
"Module Summary Analysis" | , | ||
false | , | ||
true | |||
) |
Referenced by llvm::ModuleSummaryIndexAnalysis::run().
|
static |
Definition at line 132 of file ModuleSummaryAnalysis.cpp.
References llvm::GlobalValue::hasLocalLinkage(), and llvm::GlobalValue::hasSection().
Referenced by computeAliasSummary(), computeFunctionSummary(), and computeVariableSummary().
|
static |
Definition at line 223 of file ModuleSummaryAnalysis.cpp.
Referenced by computeFunctionSummary().
|
static |
Definition at line 449 of file ModuleSummaryAnalysis.cpp.
References llvm::GlobalValue::getGUID(), llvm::ModuleSummaryIndex::getValueInfo(), and VI.
Referenced by llvm::buildModuleSummaryIndex().
module summary analysis |
Definition at line 653 of file ModuleSummaryAnalysis.cpp.
module summary Module Summary Analysis |
Definition at line 653 of file ModuleSummaryAnalysis.cpp.
module summary Module Summary false |
Definition at line 653 of file ModuleSummaryAnalysis.cpp.
FunctionSummary::ForceSummaryHotnessType ForceSummaryEdgesCold |
Definition at line 64 of file ModuleSummaryAnalysis.cpp.
Referenced by computeFunctionSummary().
cl::opt<FunctionSummary::ForceSummaryHotnessType, true> FSEC("force-summary-edges-cold", cl::Hidden, cl::location(ForceSummaryEdgesCold), cl::desc("Force all edges in the function summary to cold"), cl::values(clEnumValN(FunctionSummary::FSHT_None, "none", "None."), clEnumValN(FunctionSummary::FSHT_AllNonCritical, "all-non-critical", "All non-critical edges."), clEnumValN(FunctionSummary::FSHT_All, "all", "All edges."))) |