Go to the documentation of this file.
18 #define DEBUG_TYPE "inferattrs"
30 if (
F.isDeclaration() && !
F.hasOptNone()) {
31 if (!
F.hasFnAttribute(Attribute::NoBuiltin))
57 struct InferFunctionAttrsLegacyPass :
public ModulePass {
68 bool runOnModule(
Module &M)
override {
73 return this->getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
F);
82 "Infer set function attributes",
false,
false)
88 return new InferFunctionAttrsLegacyPass();
A set of analyses that are preserved following a run of a transformation pass.
We currently generate a but we really shouldn eax ecx xorl edx divl ecx eax divl ecx movl eax ret A similar code sequence works for division We currently compile i32 v2 eax eax jo LBB1_2 atomic and others It is also currently not done for read modify write instructions It is also current not done if the OF or CF flags are needed The shift operators have the complication that when the shift count is EFLAGS is not set
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
void initializeInferFunctionAttrsLegacyPassPass(PassRegistry &)
FunctionAnalysisManager FAM
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
Pass * createInferFunctionAttrsLegacyPass()
Create a legacy pass manager instance of a pass to infer function attributes.
Infer set function attributes
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
INITIALIZE_PASS_BEGIN(InferFunctionAttrsLegacyPass, "inferattrs", "Infer set function attributes", false, false) INITIALIZE_PASS_END(InferFunctionAttrsLegacyPass
Represent the analysis usage information of a pass.
bool inferAttributesFromOthers(Function &F)
If we can infer one attribute from another on the declaration of a function, explicitly materialize t...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
An efficient, type-erasing, non-owning reference to a callable.
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
static bool inferAllPrototypeAttributes(Module &M, function_ref< TargetLibraryInfo &(Function &)> GetTLI)
print Print MemDeps of function
A Module instance is used to store all the information related to an LLVM module.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Provides information about what library functions are available for the current target.
Pass interface - Implemented by all 'passes'.
A container for analyses that lazily runs them and caches their results.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
bool inferNonMandatoryLibFuncAttrs(Module *M, StringRef Name, const TargetLibraryInfo &TLI)
Analyze the name and prototype of the given function and set any applicable attributes.
AnalysisUsage & addRequired()
Analysis pass providing the TargetLibraryInfo.