LLVM  7.0.0svn
Macros | Functions | Variables
ModuleSummaryAnalysis.cpp File Reference
#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 <algorithm>
#include <cassert>
#include <cstdint>
#include <vector>
Include dependency graph for ModuleSummaryAnalysis.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "module-summary-analysis"


static void findRefEdges (ModuleSummaryIndex &Index, const User *CurUser, SetVector< ValueInfo > &RefEdges, SmallPtrSet< const User *, 8 > &Visited)
static CalleeInfo::HotnessType getHotness (uint64_t ProfileCount, ProfileSummaryInfo *PSI)
static bool isNonRenamableLocal (const GlobalValue &GV)
static void addVCallToSet (DevirtCallSite Call, GlobalValue::GUID Guid, SetVector< FunctionSummary::VFuncId > &VCalls, SetVector< FunctionSummary::ConstVCall > &ConstVCalls)
 Determine whether this call has all constant integer arguments (excluding "this") and summarize it to VCalls or ConstVCalls as appropriate. More...
static void addIntrinsicToSummary (const CallInst *CI, SetVector< GlobalValue::GUID > &TypeTests, SetVector< FunctionSummary::VFuncId > &TypeTestAssumeVCalls, SetVector< FunctionSummary::VFuncId > &TypeCheckedLoadVCalls, SetVector< FunctionSummary::ConstVCall > &TypeTestAssumeConstVCalls, SetVector< FunctionSummary::ConstVCall > &TypeCheckedLoadConstVCalls)
 If this intrinsic call requires that we add information to the function summary, do so via the non-constant reference arguments. More...
static void computeFunctionSummary (ModuleSummaryIndex &Index, const Module &M, const Function &F, BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI, bool HasLocalsInUsedOrAsm, DenseSet< GlobalValue::GUID > &CantBePromoted)
static void computeVariableSummary (ModuleSummaryIndex &Index, const GlobalVariable &V, DenseSet< GlobalValue::GUID > &CantBePromoted)
static void computeAliasSummary (ModuleSummaryIndex &Index, const GlobalAlias &A, DenseSet< GlobalValue::GUID > &CantBePromoted)
static void setLiveRoot (ModuleSummaryIndex &Index, StringRef Name)
 INITIALIZE_PASS_BEGIN (ModuleSummaryIndexWrapperPass, "module-summary-analysis", "Module Summary Analysis", false, true) INITIALIZE_PASS_END(ModuleSummaryIndexWrapperPass


module summary analysis
module summary Module Summary Analysis
module summary Module Summary false

Macro Definition Documentation


#define DEBUG_TYPE   "module-summary-analysis"

Definition at line 59 of file ModuleSummaryAnalysis.cpp.

Function Documentation

◆ addIntrinsicToSummary()

static void addIntrinsicToSummary ( const CallInst CI,
SetVector< GlobalValue::GUID > &  TypeTests,
SetVector< FunctionSummary::VFuncId > &  TypeTestAssumeVCalls,
SetVector< FunctionSummary::VFuncId > &  TypeCheckedLoadVCalls,
SetVector< FunctionSummary::ConstVCall > &  TypeTestAssumeConstVCalls,
SetVector< FunctionSummary::ConstVCall > &  TypeCheckedLoadConstVCalls 

◆ addVCallToSet()

static void addVCallToSet ( DevirtCallSite  Call,
GlobalValue::GUID  Guid,
SetVector< FunctionSummary::VFuncId > &  VCalls,
SetVector< FunctionSummary::ConstVCall > &  ConstVCalls 

◆ computeAliasSummary()

static void computeAliasSummary ( ModuleSummaryIndex Index,
const GlobalAlias A,
DenseSet< GlobalValue::GUID > &  CantBePromoted 

◆ computeFunctionSummary()

static void computeFunctionSummary ( ModuleSummaryIndex Index,
const Module M,
const Function F,
BlockFrequencyInfo BFI,
ProfileSummaryInfo PSI,
bool  HasLocalsInUsedOrAsm,
DenseSet< GlobalValue::GUID > &  CantBePromoted 

◆ computeVariableSummary()

static void computeVariableSummary ( ModuleSummaryIndex Index,
const GlobalVariable V,
DenseSet< GlobalValue::GUID > &  CantBePromoted 

◆ findRefEdges()

static void findRefEdges ( ModuleSummaryIndex Index,
const User CurUser,
SetVector< ValueInfo > &  RefEdges,
SmallPtrSet< const User *, 8 > &  Visited 

◆ getHotness()

static CalleeInfo::HotnessType getHotness ( uint64_t  ProfileCount,
ProfileSummaryInfo PSI 


INITIALIZE_PASS_BEGIN ( ModuleSummaryIndexWrapperPass  ,
"module-summary-analysis ,
"Module Summary Analysis ,
false  ,

◆ isNonRenamableLocal()

static bool isNonRenamableLocal ( const GlobalValue GV)

◆ setLiveRoot()

static void setLiveRoot ( ModuleSummaryIndex Index,
StringRef  Name 

Variable Documentation

◆ analysis

module summary analysis

Definition at line 560 of file ModuleSummaryAnalysis.cpp.

◆ Analysis

module summary Module Summary Analysis

Definition at line 560 of file ModuleSummaryAnalysis.cpp.

◆ false

module summary Module Summary false

Definition at line 560 of file ModuleSummaryAnalysis.cpp.