Go to the documentation of this file.
35 const std::string &Banner)
const {
42 if (
F.hasAvailableExternallyLinkage())
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 =
67 F.getParent()->shouldEmitInstrCountChangedRemark();
71 if (ShouldEmitSizeRemarks)
80 PassID = PI->getPassArgument();
86 if (ShouldPrintChanged) {
91 bool RV = runOnMachineFunction(MF);
93 if (ShouldEmitSizeRemarks) {
97 if (CountBefore != CountAfter) {
100 int64_t Delta =
static_cast<int64_t
>(CountAfter) -
101 static_cast<int64_t
>(CountBefore);
105 R <<
NV(
"Pass", getPassName())
106 <<
": Function: " <<
NV(
"Function",
F.getName()) <<
": "
107 <<
"MI Instruction count changed from "
108 <<
NV(
"MIInstrsBefore", CountBefore) <<
" to "
109 <<
NV(
"MIInstrsAfter", CountAfter)
110 <<
"; Delta: " <<
NV(
"Delta", Delta);
116 MFProps.
set(SetProperties);
117 MFProps.
reset(ClearedProperties);
121 if (ShouldPrintChanged || !IsInterestingPass) {
122 if (ShouldPrintChanged) {
126 if (IsInterestingPass && BeforeStr != AfterStr) {
127 errs() << (
"*** IR Dump After " + getPassName() +
" (" + PassID +
128 ") on " + MF.
getName() +
" ***\n");
145 StringRef Removed = Color ?
"\033[31m-%l\033[0m\n" :
"-%l\n";
157 IsInterestingPass ?
" omitted because no change" :
" filtered out";
158 errs() <<
"*** IR Dump After " << getPassName();
160 errs() <<
" (" << PassID <<
")";
161 errs() <<
" on " << MF.
getName() + Reason +
" ***\n";
cl::opt< ChangePrinter > PrintChanged
This is an optimization pass for GlobalISel generic memory operations.
void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
DISubprogram * getSubprogram() const
Get the attached subprogram.
unsigned getInstructionCount() const
Return the number of MachineInstrs in this MachineFunction.
The legacy pass manager's analysis pass to compute loop information.
PassInfo class - An instance of this class exists for every pass known by the system,...
Properties which a MachineFunction may have at a given point in time.
DiagnosticInfoOptimizationBase::Argument NV
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const MachineBasicBlock & front() const
static const PassInfo * lookupPassInfo(const void *TI)
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
Represent the analysis usage information of a pass.
const MachineFunctionProperties & getProperties() const
Get the function properties.
MachineFunctionProperties & set(Property P)
This class contains meta information specific to a module.
Legacy analysis pass which computes a DominatorTree.
This class implements an extremely fast bulk output stream that can only output to a stream.
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...
constexpr bool empty() const
empty - Check if the string is empty.
Legacy wrapper pass to provide the SCEVAAResult object.
Legacy wrapper pass to provide the BasicAAResult object.
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
bool isFunctionInPrintList(StringRef FunctionName)
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
MachineFunctionProperties & reset(Property P)
static bool runOnFunction(Function &F, bool PostInlining)
Function & getFunction()
Return the LLVM function that this machine code represents.
A wrapper analysis pass for the legacy pass manager that exposes a MemoryDepnedenceResults instance.
std::string doSystemDiff(StringRef Before, StringRef After, StringRef OldLineFormat, StringRef NewLineFormat, StringRef UnchangedLineFormat)
bool isPassInPrintList(StringRef PassName)
void print(raw_ostream &OS, const SlotIndexes *=nullptr) const
print - Print out the MachineFunction in a format suitable for debugging to the specified stream.
Pass interface - Implemented by all 'passes'.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
Legacy wrapper pass to provide the GlobalsAAResult object.
A raw_ostream that writes to an SmallVector or SmallString.
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
AnalysisUsage & addRequired()