struct InformationCache
Declaration
struct InformationCache { /* full declaration omitted */ };
Description
Data structure to hold cached (LLVM-IR) information. All attributes are given an InformationCache object at creation time to avoid inspection of the IR by all of them individually. This default InformationCache will hold information required by 'default' attributes, thus the ones deduced when Attributor::identifyDefaultAbstractAttributes(..) is called. If custom abstract attributes, registered manually through Attributor::registerAA(...), need more information, especially if it is not reusable, it is advised to inherit from the InformationCache and cast the instance down in the abstract attributes.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:996
Member Variables
- public SmallPtrSet<llvm::Function*, 8> ModuleSlice
- The slice of the module we are allowed to look at.
- private DenseMap<const llvm::Function*, llvm::InformationCache::FunctionInfo*> FuncInfoMap
- A map type from functions to informatio about it.
- private const llvm::DataLayout& DL
- The datalayout used in the module.
- private llvm::BumpPtrAllocator& Allocator
- The allocator used to allocate memory, e.g. for `FunctionInfo`s.
- private llvm::MustBeExecutedContextExplorer Explorer
- MustBeExecutedContextExplorer
- private llvm::RetainedKnowledgeMap KnowledgeMap
- A map with knowledge retained in `llvm.assume` instructions.
- private SetVector<const llvm::Instruction*> AssumeOnlyValues
- A container for all instructions that are only used by `llvm.assume`.
- private llvm::AnalysisGetter& AG
- Getters for analysis.
- private SmallPtrSet<const llvm::Function*, 8> InlineableFunctions
- Set of inlineable functions
- private DenseMap<std::pair<const Instruction*, const Instruction*>, bool> PotentiallyReachableMap
- A map for caching results of queries for isPotentiallyReachable
- private llvm::Triple TargetTriple
- The triple describing the target machine.
Method Overview
- public InformationCache(const llvm::Module & M, llvm::AnalysisGetter & AG, llvm::BumpPtrAllocator & Allocator, SetVector<llvm::Function *> * CGSCC)
- public template <typename CBTy>static void foreachUse(llvm::Function & F, CBTy CB, bool LookThroughConstantExprUses = true)
- public llvm::AAResults * getAAResultsForFunction(const llvm::Function & F)
- public template <typename AP>typename AP::Result * getAnalysisResultForFunction(const llvm::Function & F)
- public const llvm::DataLayout & getDL()
- private llvm::InformationCache::FunctionInfo & getFunctionInfo(const llvm::Function & F)
- public const llvm::RetainedKnowledgeMap & getKnowledgeMap() const
- public llvm::MustBeExecutedContextExplorer & getMustBeExecutedContextExplorer()
- public llvm::InformationCache::OpcodeInstMapTy & getOpcodeInstMapForFunction(const llvm::Function & F)
- public bool getPotentiallyReachable(const llvm::Instruction & From, const llvm::Instruction & To)
- public llvm::InformationCache::InstructionVectorTy & getReadOrWriteInstsForFunction(const llvm::Function & F)
- public llvm::TargetLibraryInfo * getTargetLibraryInfoForFunction(const llvm::Function & F)
- private void initializeInformationCache(const llvm::Function & F, llvm::InformationCache::FunctionInfo & FI)
- public void initializeModuleSlice(SetVector<llvm::Function *> & SCC)
- public bool isInModuleSlice(const llvm::Function & F)
- public bool isInvolvedInMustTailCall(const llvm::Argument & Arg)
- public bool isOnlyUsedByAssume(const llvm::Instruction & I) const
- public bool stackIsAccessibleByOtherThreads()
- public bool targetIsGPU()
- public ~InformationCache()
Methods
¶InformationCache(
const llvm::Module& M,
llvm::AnalysisGetter& AG,
llvm::BumpPtrAllocator& Allocator,
SetVector<llvm::Function*>* CGSCC)
InformationCache(
const llvm::Module& M,
llvm::AnalysisGetter& AG,
llvm::BumpPtrAllocator& Allocator,
SetVector<llvm::Function*>* CGSCC)
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:997
Parameters
- const llvm::Module& M
- llvm::AnalysisGetter& AG
- llvm::BumpPtrAllocator& Allocator
- SetVector<llvm::Function*>* CGSCC
¶template <typename CBTy>
static void foreachUse(
llvm::Function& F,
CBTy CB,
bool LookThroughConstantExprUses = true)
template <typename CBTy>
static void foreachUse(
llvm::Function& F,
CBTy CB,
bool LookThroughConstantExprUses = true)
Description
Apply \p CB to all uses of \p F. If \p LookThroughConstantExprUses is true, constant expression users are not given to \p CB but their uses are traversed transitively.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1029
Templates
- CBTy
Parameters
- llvm::Function& F
- CBTy CB
- bool LookThroughConstantExprUses = true
¶llvm::AAResults* getAAResultsForFunction(
const llvm::Function& F)
llvm::AAResults* getAAResultsForFunction(
const llvm::Function& F)
Description
Return AliasAnalysis Result for function \p F.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1115
Parameters
- const llvm::Function& F
¶template <typename AP>
typename AP::Result* getAnalysisResultForFunction(
const llvm::Function& F)
template <typename AP>
typename AP::Result* getAnalysisResultForFunction(
const llvm::Function& F)
Description
Return the analysis result from a pass \p AP for function \p F.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1130
Templates
- AP
Parameters
- const llvm::Function& F
¶const llvm::DataLayout& getDL()
const llvm::DataLayout& getDL()
Description
Return datalayout used in the module.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1135
¶llvm::InformationCache::FunctionInfo&
getFunctionInfo(const llvm::Function& F)
llvm::InformationCache::FunctionInfo&
getFunctionInfo(const llvm::Function& F)
Description
Return information about the function \p F, potentially by creating it.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1193
Parameters
- const llvm::Function& F
¶const llvm::RetainedKnowledgeMap&
getKnowledgeMap() const
const llvm::RetainedKnowledgeMap&
getKnowledgeMap() const
Description
Return the map conaining all the knowledge we have from `llvm.assume`s.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1138
¶llvm::MustBeExecutedContextExplorer&
getMustBeExecutedContextExplorer()
llvm::MustBeExecutedContextExplorer&
getMustBeExecutedContextExplorer()
Description
Return MustBeExecutedContextExplorer
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1105
¶llvm::InformationCache::OpcodeInstMapTy&
getOpcodeInstMapForFunction(
const llvm::Function& F)
llvm::InformationCache::OpcodeInstMapTy&
getOpcodeInstMapForFunction(
const llvm::Function& F)
Description
Return the map that relates "interesting" opcodes with all instructions with that opcode in \p F.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1095
Parameters
- const llvm::Function& F
¶bool getPotentiallyReachable(
const llvm::Instruction& From,
const llvm::Instruction& To)
bool getPotentiallyReachable(
const llvm::Instruction& From,
const llvm::Instruction& To)
Description
Return if \p To is potentially reachable form \p From or not If the same query was answered, return cached result
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1142
Parameters
- const llvm::Instruction& From
- const llvm::Instruction& To
¶llvm::InformationCache::InstructionVectorTy&
getReadOrWriteInstsForFunction(
const llvm::Function& F)
llvm::InformationCache::InstructionVectorTy&
getReadOrWriteInstsForFunction(
const llvm::Function& F)
Description
Return the instructions in \p F that may read or write memory.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1100
Parameters
- const llvm::Function& F
¶llvm::TargetLibraryInfo*
getTargetLibraryInfoForFunction(
const llvm::Function& F)
llvm::TargetLibraryInfo*
getTargetLibraryInfoForFunction(
const llvm::Function& F)
Description
Return TargetLibraryInfo for function \p F.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1110
Parameters
- const llvm::Function& F
¶void initializeInformationCache(
const llvm::Function& F,
llvm::InformationCache::FunctionInfo& FI)
void initializeInformationCache(
const llvm::Function& F,
llvm::InformationCache::FunctionInfo& FI)
Description
Initialize the function information cache \p FI for the function \p F. This method needs to be called for all function that might be looked at through the information cache interface *prior* to looking at them.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1206
Parameters
- const llvm::Function& F
- llvm::InformationCache::FunctionInfo& FI
¶void initializeModuleSlice(
SetVector<llvm::Function*>& SCC)
void initializeModuleSlice(
SetVector<llvm::Function*>& SCC)
Description
Initialize the ModuleSlice member based on \p SCC. ModuleSlices contains (a subset of) all functions that we can look at during this SCC traversal. This includes functions (transitively) called from the SCC and the (transitive) callers of SCC functions. We also can look at a function if there is a "reference edge", i.a., if the function somehow uses (!=calls) a function in the SCC or a caller of a function in the SCC.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1053
Parameters
- SetVector<llvm::Function*>& SCC
¶bool isInModuleSlice(const llvm::Function& F)
bool isInModuleSlice(const llvm::Function& F)
Description
Check whether \p F is part of module slice.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1158
Parameters
- const llvm::Function& F
¶bool isInvolvedInMustTailCall(
const llvm::Argument& Arg)
bool isInvolvedInMustTailCall(
const llvm::Argument& Arg)
Description
Return true if \p Arg is involved in a must-tail call, thus the argument of the caller or callee.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1119
Parameters
- const llvm::Argument& Arg
¶bool isOnlyUsedByAssume(
const llvm::Instruction& I) const
bool isOnlyUsedByAssume(
const llvm::Instruction& I) const
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1124
Parameters
- const llvm::Instruction& I
¶bool stackIsAccessibleByOtherThreads()
bool stackIsAccessibleByOtherThreads()
Description
Return true if the stack (llvm::Alloca) can be accessed by other threads.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1163
¶bool targetIsGPU()
bool targetIsGPU()
Description
Return true if the target is a GPU.
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1166
¶~InformationCache()
~InformationCache()
Declared at: llvm/include/llvm/Transforms/IPO/Attributor.h:1018