LLVM 20.0.0git
|
Data structure to hold cached (LLVM-IR) information. More...
#include "llvm/Transforms/IPO/Attributor.h"
Public Types | |
using | InstructionVectorTy = SmallVector< Instruction *, 8 > |
A vector type to hold instructions. | |
using | OpcodeInstMapTy = DenseMap< unsigned, InstructionVectorTy * > |
A map type from opcodes to instructions with this opcode. | |
Public Member Functions | |
InformationCache (const Module &M, AnalysisGetter &AG, BumpPtrAllocator &Allocator, SetVector< Function * > *CGSCC, bool UseExplorer=true) | |
~InformationCache () | |
OpcodeInstMapTy & | getOpcodeInstMapForFunction (const Function &F) |
Return the map that relates "interesting" opcodes with all instructions with that opcode in F . | |
InstructionVectorTy & | getReadOrWriteInstsForFunction (const Function &F) |
Return the instructions in F that may read or write memory. | |
MustBeExecutedContextExplorer * | getMustBeExecutedContextExplorer () |
Return MustBeExecutedContextExplorer. | |
TargetLibraryInfo * | getTargetLibraryInfoForFunction (const Function &F) |
Return TargetLibraryInfo for function F . | |
bool | isInvolvedInMustTailCall (const Argument &Arg) |
Return true if Arg is involved in a must-tail call, thus the argument of the caller or callee. | |
bool | isOnlyUsedByAssume (const Instruction &I) const |
void | invalidateAnalyses () |
Invalidates the cached analyses. | |
template<typename AP > | |
AP::Result * | getAnalysisResultForFunction (const Function &F, bool CachedOnly=false) |
Return the analysis result from a pass AP for function F . | |
const DataLayout & | getDL () |
Return datalayout used in the module. | |
const RetainedKnowledgeMap & | getKnowledgeMap () const |
Return the map conaining all the knowledge we have from llvm.assume s. | |
const AA::InstExclusionSetTy * | getOrCreateUniqueBlockExecutionSet (const AA::InstExclusionSetTy *BES) |
Given BES , return a uniqued version. | |
bool | stackIsAccessibleByOtherThreads () |
Return true if the stack (llvm::Alloca) can be accessed by other threads. | |
bool | targetIsGPU () |
Return true if the target is a GPU. | |
const ArrayRef< Function * > | getIndirectlyCallableFunctions (Attributor &A) const |
Return all functions that might be called indirectly, only valid for closed world modules (see isClosedWorldModule). | |
std::optional< unsigned > | getFlatAddressSpace () const |
Return the flat address space if the associated target has. | |
Static Public Member Functions | |
template<typename CBTy > | |
static void | foreachUse (Function &F, CBTy CB, bool LookThroughConstantExprUses=true) |
Apply CB to all uses of F . | |
Public Attributes | |
const SetVector< Function * > *const | CGSCC = nullptr |
The CG-SCC the pass is run on, or nullptr if it is a module pass. | |
Friends | |
struct | Attributor |
Give the Attributor access to the members so Attributor::identifyDefaultAbstractAttributes(...) can initialize them. | |
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.
Definition at line 1203 of file Attributor.h.
A vector type to hold instructions.
Definition at line 1264 of file Attributor.h.
A map type from opcodes to instructions with this opcode.
Definition at line 1267 of file Attributor.h.
|
inline |
Definition at line 1204 of file Attributor.h.
References Allocator, F, and llvm::AnalysisGetter::getAnalysis().
|
inline |
Definition at line 1225 of file Attributor.h.
|
inlinestatic |
Apply CB
to all uses of F
.
If LookThroughConstantExprUses
is true, constant expression users are not given to CB
but their uses are traversed transitively.
Definition at line 1242 of file Attributor.h.
References F, Idx, llvm::make_pointer_range(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase< Size_T >::size(), and llvm::Value::uses().
|
inline |
Return the analysis result from a pass AP
for function F
.
Definition at line 1307 of file Attributor.h.
References F, and llvm::AnalysisGetter::getAnalysis().
Referenced by llvm::AANonNull::isImpliedByIR(), and llvm::AA::isValidAtPosition().
|
inline |
Return datalayout used in the module.
Definition at line 1313 of file Attributor.h.
std::optional< unsigned > InformationCache::getFlatAddressSpace | ( | ) | const |
Return the flat address space if the associated target has.
Definition at line 3296 of file Attributor.cpp.
References llvm::Triple::isAMDGPU(), and llvm::Triple::isNVPTX().
const ArrayRef< Function * > InformationCache::getIndirectlyCallableFunctions | ( | Attributor & | A | ) | const |
Return all functions that might be called indirectly, only valid for closed world modules (see isClosedWorldModule).
Definition at line 3291 of file Attributor.cpp.
|
inline |
Return the map conaining all the knowledge we have from llvm.assume
s.
Definition at line 1316 of file Attributor.h.
Referenced by llvm::Attributor::getAttrsFromAssumes().
|
inline |
Return MustBeExecutedContextExplorer.
Definition at line 1281 of file Attributor.h.
Referenced by llvm::Attributor::getAttrsFromAssumes().
|
inline |
Return the map that relates "interesting" opcodes with all instructions with that opcode in F
.
Definition at line 1271 of file Attributor.h.
References F.
Referenced by llvm::Attributor::checkForAllInstructions(), llvm::Attributor::identifyDefaultAbstractAttributes(), and llvm::Attributor::isValidFunctionSignatureRewrite().
|
inline |
Given BES
, return a uniqued version.
Definition at line 1320 of file Attributor.h.
|
inline |
Return the instructions in F
that may read or write memory.
Definition at line 1276 of file Attributor.h.
References F.
Referenced by llvm::Attributor::checkForAllReadWriteInstructions().
|
inline |
Return TargetLibraryInfo for function F
.
Definition at line 1286 of file Attributor.h.
References F, and llvm::AnalysisGetter::getAnalysis().
|
inline |
Invalidates the cached analyses.
Valid only when using the new pass manager.
Definition at line 1303 of file Attributor.h.
References llvm::AnalysisGetter::invalidateAnalyses().
Return true if Arg
is involved in a must-tail call, thus the argument of the caller or callee.
Definition at line 1292 of file Attributor.h.
References llvm::Argument::getParent().
|
inline |
Definition at line 1297 of file Attributor.h.
References I.
|
inline |
Return true if the stack (llvm::Alloca) can be accessed by other threads.
Definition at line 1332 of file Attributor.h.
References targetIsGPU().
Referenced by llvm::AA::isAssumedThreadLocalObject().
|
inline |
Return true if the target is a GPU.
Definition at line 1335 of file Attributor.h.
References llvm::Triple::isAMDGPU(), and llvm::Triple::isNVPTX().
Referenced by stackIsAccessibleByOtherThreads().
|
friend |
Give the Attributor access to the members so Attributor::identifyDefaultAbstractAttributes(...) can initialize them.
Definition at line 1418 of file Attributor.h.
The CG-SCC the pass is run on, or nullptr if it is a module pass.
Definition at line 1261 of file Attributor.h.