35 const std::string &Banner)
const {
52 errs() <<
"MachineFunctionProperties required by " << getPassName()
53 <<
" pass are not met by function " << F.
getName() <<
".\n" 54 <<
"Required properties: ";
55 RequiredProperties.print(
errs());
56 errs() <<
"\nCurrent properties: ";
63 unsigned CountBefore, CountAfter;
66 bool ShouldEmitSizeRemarks =
71 if (ShouldEmitSizeRemarks)
72 CountBefore = MF.getInstructionCount();
74 bool RV = runOnMachineFunction(MF);
76 if (ShouldEmitSizeRemarks) {
79 CountAfter = MF.getInstructionCount();
80 if (CountBefore != CountAfter) {
83 int64_t Delta =
static_cast<int64_t
>(CountAfter) -
84 static_cast<int64_t>(CountBefore);
86 MF.getFunction().getSubprogram(),
88 R <<
NV(
"Pass", getPassName())
89 <<
": Function: " <<
NV(
"Function", F.
getName()) <<
": " 90 <<
"MI Instruction count changed from " 91 <<
NV(
"MIInstrsBefore", CountBefore) <<
" to " 92 <<
NV(
"MIInstrsAfter", CountAfter)
93 <<
"; Delta: " <<
NV(
"Delta", Delta);
99 MFProps.
set(SetProperties);
100 MFProps.
reset(ClearedProperties);
Legacy wrapper pass to provide the GlobalsAAResult object.
Pass interface - Implemented by all 'passes'.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
DiagnosticInfoOptimizationBase::Argument NV
This class represents lattice values for constants.
MachineFunctionProperties & reset(Property P)
This is the interface for a simple mod/ref and alias analysis over globals.
bool hasAvailableExternallyLinkage() const
AnalysisUsage & addRequired()
void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
This is the interface for a SCEV-based alias analysis.
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
static bool runOnFunction(Function &F, bool PostInlining)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
bool shouldEmitInstrCountChangedRemark()
Return true if size-info optimization remark is enabled, false otherwise.
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
Represent the analysis usage information of a pass.
MachineFunction & getOrCreateMachineFunction(const Function &F)
Returns the MachineFunction constructed for the IR function F.
A wrapper analysis pass for the legacy pass manager that exposes a MemoryDepnedenceResults instance...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Legacy wrapper pass to provide the SCEVAAResult object.
MachineFunctionPass * createMachineFunctionPrinterPass(raw_ostream &OS, const std::string &Banner="")
MachineFunctionPrinter pass - This pass prints out the machine function to the given stream as a debu...
MachineFunctionProperties & set(Property P)
StringRef getName() const
Return a constant reference to the value's name.
Module * getParent()
Get the module that this global value is contained inside of...
This class implements an extremely fast bulk output stream that can only output to a stream...
The legacy pass manager's analysis pass to compute loop information.
This is the interface for LLVM's primary stateless and local alias analysis.
Legacy analysis pass which computes a DominatorTree.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object...
Properties which a MachineFunction may have at a given point in time.
This class contains meta information specific to a module.
Legacy wrapper pass to provide the BasicAAResult object.