20 if (
F.isDeclaration())
23 if (
F.hasOptNone() ||
F.hasOptSize() ||
F.hasMinSize())
25 if (
F.hasFnAttribute(Attribute::Cold))
40 bool MadeChange =
false;
49 F.addFnAttr(Attribute::OptimizeForSize);
52 F.addFnAttr(Attribute::MinSize);
56 if (
F.hasFnAttribute(Attribute::AlwaysInline))
58 F.addFnAttr(Attribute::OptimizeNone);
59 F.addFnAttr(Attribute::NoInline);
Module.h This file contains the declarations for the Module class.
static bool shouldRunOnFunction(Function &F, ProfileSummaryInfo &PSI, FunctionAnalysisManager &FAM)
FunctionAnalysisManager FAM
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Analysis pass which computes BlockFrequencyInfo.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
An analysis pass based on the new PM to deliver ProfileSummaryInfo.
Analysis providing profile information.
bool hasProfileSummary() const
Returns true if profile summary is available.
bool isFunctionColdInCallGraph(const FuncT *F, BFIT &BFI) const
Returns true if F contains only cold code.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)