20 #define DEBUG_TYPE "inferattrs" 49 struct InferFunctionAttrsLegacyPass :
public ModulePass {
51 InferFunctionAttrsLegacyPass() :
ModulePass(ID) {
60 bool runOnModule(
Module &M)
override {
64 auto &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
72 "Infer set function attributes",
false,
false)
78 return new InferFunctionAttrsLegacyPass();
Pass interface - Implemented by all 'passes'.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
static bool inferAllPrototypeAttributes(Module &M, const TargetLibraryInfo &TLI)
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
void initializeInferFunctionAttrsLegacyPassPass(PassRegistry &)
Infer set function attributes
INITIALIZE_PASS_BEGIN(InferFunctionAttrsLegacyPass, "inferattrs", "Infer set function attributes", false, false) INITIALIZE_PASS_END(InferFunctionAttrsLegacyPass
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
bool inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI)
Analyze the name and prototype of the given function and set any applicable attributes.
A set of analyses that are preserved following a run of a transformation pass.
iterator_range< iterator > functions()
Represent the analysis usage information of a pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
Module.h This file contains the declarations for the Module class.
Provides information about what library functions are available for the current target.
Interfaces for passes which infer implicit function attributes from the name and signature of functio...
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Pass * createInferFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to infer function attributes.
Analysis pass providing the TargetLibraryInfo.
print Print MemDeps of function
A container for analyses that lazily runs them and caches their results.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)