LLVM
17.0.0git
|
#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/MemoryProfileInfo.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Analysis/StackSafetyAnalysis.h"
#include "llvm/Analysis/TypeMetadataUtils.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.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/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/User.h"
#include "llvm/InitializePasses.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 "llvm/Support/FileSystem.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <vector>
Go to the source code of this file.
Namespaces | |
llvm | |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "module-summary-analysis" |
Variables | |
FunctionSummary::ForceSummaryHotnessType | llvm::ForceSummaryEdgesCold |
static 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."))) |
static cl::opt< std::string > | ModuleSummaryDotFile ("module-summary-dot-file", cl::Hidden, cl::value_desc("filename"), cl::desc("File to emit dot graph of new summary into")) |
module summary | analysis |
module summary Module Summary | Analysis |
module summary Module Summary | false |
#define DEBUG_TYPE "module-summary-analysis" |
Definition at line 62 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 163 of file ModuleSummaryAnalysis.cpp.
References addVCallToSet(), llvm::any_of(), llvm::findDevirtualizableCallsForTypeCheckedLoad(), llvm::findDevirtualizableCallsForTypeTest(), llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::GlobalValue::getGUID(), llvm::Function::getIntrinsicID(), llvm::SetVector< T, Vector, Set >::insert(), 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 145 of file ModuleSummaryAnalysis.cpp.
References Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::drop_begin(), llvm::SetVector< T, Vector, Set >::insert(), and move.
Referenced by addIntrinsicToSummary().
|
static |
Definition at line 708 of file ModuleSummaryAnalysis.cpp.
References assert(), llvm::GlobalValue::getGUID(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert(), isNonRenamableLocal(), and move.
Referenced by llvm::buildModuleSummaryIndex().
|
static |
Definition at line 253 of file ModuleSummaryAnalysis.cpp.
References addIntrinsicToSummary(), assert(), BB, llvm::memprof::CallStack< NodeT, IteratorT >::beginAfterSharedPrefix(), llvm::AMDGPUISD::BFI, Callee, llvm::CalleeInfo::Cold, llvm::CalleeInfo::Critical, llvm::memprof::CallStack< NodeT, IteratorT >::empty(), llvm::memprof::CallStack< NodeT, IteratorT >::end(), llvm::SmallVectorImpl< T >::erase(), F, findRefEdges(), llvm::ForceSummaryEdgesCold, llvm::FunctionSummary::FSHT_All, llvm::FunctionSummary::FSHT_None, llvm::BlockAddress::get(), getHotness(), llvm::memprof::getMIBAllocType(), llvm::memprof::getMIBStackNode(), llvm::ProfileSummaryInfo::getProfileCount(), llvm::ICallPromotionAnalysis::getPromotionCandidatesForInstruction(), I, llvm::SetVector< T, Vector, Set >::insert(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), isNonRenamableLocal(), isNonVolatileLoad(), isNonVolatileStore(), move, mustBeUnreachableFunction(), llvm::SetVector< T, Vector, Set >::remove(), llvm::SetVector< T, Vector, Set >::size(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::takeVector(), llvm::SetVector< T, Vector, Set >::takeVector(), llvm::CalleeInfo::Unknown, users, and VI.
Referenced by llvm::buildModuleSummaryIndex().
|
static |
Definition at line 661 of file ModuleSummaryAnalysis.cpp.
References llvm::GlobalValue::canBeOmittedFromSymbolTable(), computeVTableFuncs(), findRefEdges(), llvm::GlobalValue::getGUID(), llvm::GlobalValue::getLinkage(), llvm::GlobalObject::getMetadata(), llvm::GlobalObject::getVCallVisibility(), llvm::GlobalValue::getVisibility(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalObject::hasComdat(), llvm::GlobalValue::hasDLLExportStorageClass(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert(), llvm::GlobalVariable::isConstant(), llvm::GlobalValue::isDSOLocal(), llvm::GlobalValue::isInterposable(), isNonRenamableLocal(), M, move, recordTypeIdCompatibleVtableReferences(), and llvm::SetVector< T, Vector, Set >::takeVector().
Referenced by llvm::buildModuleSummaryIndex().
|
static |
Definition at line 620 of file ModuleSummaryAnalysis.cpp.
References assert(), findFuncPointers(), llvm::GlobalVariable::getInitializer(), llvm::GlobalVariable::isConstant(), M, and P.
Referenced by computeVariableSummary().
|
static |
Find function pointers referenced within the given vtable initializer (or subset of an initializer) I
.
The starting offset of I
within the vtable initializer is StartingOffset
. Any discovered function pointers are added to VTableFuncs
along with their cumulative offset within the initializer.
Definition at line 581 of file ModuleSummaryAnalysis.cpp.
References assert(), DL, llvm::numbers::e, llvm::StructType::elements(), llvm::enumerate(), llvm::StructLayout::getElementContainingOffset(), llvm::StructLayout::getElementOffset(), llvm::ArrayType::getElementType(), llvm::ArrayType::getNumElements(), i, I, and M.
Referenced by computeVTableFuncs().
|
static |
Definition at line 93 of file ModuleSummaryAnalysis.cpp.
References llvm::SetVector< T, Vector, Set >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::User::operands(), and llvm::SmallVectorImpl< T >::pop_back_val().
Referenced by computeFunctionSummary(), and computeVariableSummary().
|
static |
Definition at line 128 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 | |||
) |
|
static |
Definition at line 139 of file ModuleSummaryAnalysis.cpp.
References llvm::GlobalValue::hasLocalLinkage(), and llvm::GlobalValue::hasSection().
Referenced by computeAliasSummary(), computeFunctionSummary(), and computeVariableSummary().
|
static |
Definition at line 227 of file ModuleSummaryAnalysis.cpp.
References I.
Referenced by computeFunctionSummary().
|
static |
Definition at line 234 of file ModuleSummaryAnalysis.cpp.
Referenced by computeFunctionSummary().
Definition at line 246 of file ModuleSummaryAnalysis.cpp.
Referenced by computeFunctionSummary().
|
static |
Record vtable definition V
for each type metadata it references.
Definition at line 644 of file ModuleSummaryAnalysis.cpp.
Referenced by computeVariableSummary().
|
static |
Definition at line 731 of file ModuleSummaryAnalysis.cpp.
References llvm::GlobalValue::getGUID(), and VI.
Referenced by llvm::buildModuleSummaryIndex().
module summary analysis |
Definition at line 971 of file ModuleSummaryAnalysis.cpp.
module summary Module Summary Analysis |
Definition at line 972 of file ModuleSummaryAnalysis.cpp.
module summary Module Summary false |
Definition at line 972 of file ModuleSummaryAnalysis.cpp.
|
static |
|
static |
Referenced by llvm::buildModuleSummaryIndex().