Go to the documentation of this file.
27 bool ShouldPreserveUseListOrder)
28 : OS(OS), Banner(Banner),
29 ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {}
35 M.print(OS,
nullptr, ShouldPreserveUseListOrder);
38 bool BannerPrinted =
false;
39 for(
const auto &
F :
M.functions()) {
41 if (!BannerPrinted && !Banner.empty()) {
54 : OS(OS), Banner(Banner) {}
60 OS << Banner <<
" (function: " <<
F.getName() <<
")\n" << *
F.getParent();
62 OS << Banner << '\n' << static_cast<Value &>(
F);
69 class PrintModulePassWrapper :
public ModulePass {
75 PrintModulePassWrapper(
raw_ostream &OS,
const std::string &Banner,
76 bool ShouldPreserveUseListOrder)
77 :
ModulePass(
ID),
P(OS, Banner, ShouldPreserveUseListOrder) {}
79 bool runOnModule(
Module &M)
override {
89 StringRef getPassName()
const override {
return "Print Module IR"; }
98 PrintFunctionPassWrapper(
raw_ostream &OS,
const std::string &Banner)
112 StringRef getPassName()
const override {
return "Print Function IR"; }
119 "Print module to stderr",
false,
true)
120 char PrintFunctionPassWrapper::
ID = 0;
126 bool ShouldPreserveUseListOrder) {
127 return new PrintModulePassWrapper(OS, Banner, ShouldPreserveUseListOrder);
131 const std::string &Banner) {
132 return new PrintFunctionPassWrapper(OS, Banner);
136 const char *PID = (
const char*)
P->getPassID();
A set of analyses that are preserved following a run of a transformation pass.
Pass for printing a Function as LLVM's text IR assembly.
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
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
PreservedAnalyses run(Function &F, AnalysisManager< Function > &)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Represent the analysis usage information of a pass.
PreservedAnalyses run(Module &M, AnalysisManager< Module > &)
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool isFunctionInPrintList(StringRef FunctionName)
print Print MemDeps of function
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
INITIALIZE_PASS(PrintModulePassWrapper, "print-module", "Print module to stderr", false, true) char PrintFunctionPassWrapper INITIALIZE_PASS(PrintFunctionPassWrapper, "print-function", "Print function to stderr", false, true) ModulePass *llvm
static bool runOnFunction(Function &F, bool PostInlining)
void setPreservesAll()
Set by analyses that do not transform their input at all.
bool isIRPrintingPass(Pass *P)
Return true if a pass is for IR printing.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Pass interface - Implemented by all 'passes'.
Pass for printing a Module as LLVM's text IR assembly.
bool forcePrintModuleIR()
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
FunctionPass * createPrintFunctionPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that prints functions to the specified raw_ostream as they are processed.
ModulePass * createPrintModulePass(raw_ostream &OS, const std::string &Banner="", bool ShouldPreserveUseListOrder=false)
Create and return a pass that writes the module to the specified raw_ostream.