Polly 20.0.0git
|
Insert function calls that print certain LLVM values at run time. More...
#include <RuntimeDebugBuilder.h>
Static Public Member Functions | |
static llvm::Value * | getPrintableString (PollyIRBuilder &Builder, llvm::StringRef Str) |
Generate a constant string into the builder's llvm::Module which can be passed to createCPUPrinter(). | |
static bool | isPrintable (llvm::Type *Ty) |
Return whether an llvm::Value of the type Ty is printable for debugging. | |
template<typename... Args> | |
static void | createCPUPrinter (PollyIRBuilder &Builder, Args... args) |
Print a set of LLVM-IR Values or StringRefs via printf. | |
Static Private Member Functions | |
template<typename... Args> | |
static void | createPrinter (PollyIRBuilder &Builder, std::vector< llvm::Value * > &Values, llvm::Value *Value, Args... args) |
Handle Values. | |
template<typename... Args> | |
static void | createPrinter (PollyIRBuilder &Builder, std::vector< llvm::Value * > &Values, llvm::StringRef String, Args... args) |
Handle StringRefs. | |
template<typename... Args> | |
static void | createPrinter (PollyIRBuilder &Builder, std::vector< llvm::Value * > &Values, llvm::ArrayRef< llvm::Value * > Array, Args... args) |
Handle ArrayRefs. | |
static void | createPrinter (PollyIRBuilder &Builder, llvm::ArrayRef< llvm::Value * > Values) |
Print a list of Values. | |
static void | createCPUPrinterT (PollyIRBuilder &Builder, llvm::ArrayRef< llvm::Value * > Values) |
Print a list of Values on a CPU. | |
static llvm::Function * | getPrintF (PollyIRBuilder &Builder) |
Get a reference to the 'printf' function. | |
static void | createPrintF (PollyIRBuilder &Builder, std::string Format, llvm::ArrayRef< llvm::Value * > Values) |
Call printf. | |
static llvm::Function * | getVPrintF (PollyIRBuilder &Builder) |
Get (and possibly insert) a vprintf declaration into the module. | |
static void | createFlush (PollyIRBuilder &Builder) |
Call fflush. | |
Insert function calls that print certain LLVM values at run time.
This class inserts libc function calls to print certain LLVM values at run time.
Definition at line 30 of file RuntimeDebugBuilder.h.
|
inlinestatic |
Print a set of LLVM-IR Values or StringRefs via printf.
This function emits a call to printf that will print the given arguments. It is useful for debugging CPU programs. All arguments given in this list will be automatically concatenated and the resulting string will be printed atomically. We also support ArrayRef arguments, which can be used to provide of id values.
Builder | The builder used to emit the printer calls. |
Args | The list of values to print. |
Definition at line 61 of file RuntimeDebugBuilder.h.
References createPrinter().
Referenced by polly::PerfMonitor::AppendScopReporting(), polly::IslExprBuilder::createAccessAddress(), polly::IslNodeBuilder::createRTC(), polly::BlockGenerator::generateArrayLoad(), polly::BlockGenerator::generateBeginStmtTrace(), and polly::PerfMonitor::insertFinalReporting().
|
staticprivate |
Print a list of Values on a CPU.
Definition at line 104 of file RuntimeDebugBuilder.cpp.
References createFlush(), createPrintF(), and prepareValuesForPrinting().
|
staticprivate |
Call fflush.
@parma Builder The builder used to insert the code.
Definition at line 142 of file RuntimeDebugBuilder.cpp.
References Function, M(), and Module.
Referenced by createCPUPrinterT().
|
staticprivate |
Print a list of Values.
|
inlinestaticprivate |
Handle ArrayRefs.
Definition at line 87 of file RuntimeDebugBuilder.h.
References polly::Array, and createPrinter().
|
inlinestaticprivate |
Handle StringRefs.
Definition at line 78 of file RuntimeDebugBuilder.h.
References createPrinter(), and getPrintableString().
|
inlinestaticprivate |
Handle Values.
Definition at line 69 of file RuntimeDebugBuilder.h.
References createPrinter(), and polly::Value.
Referenced by createCPUPrinter(), and createPrinter().
|
staticprivate |
Call printf.
Builder | The builder used to insert the code. |
Format | The format string. |
Values | The set of values to print. |
Definition at line 131 of file RuntimeDebugBuilder.cpp.
References getPrintF(), and polly::Value.
Referenced by createCPUPrinterT().
|
static |
Generate a constant string into the builder's llvm::Module which can be passed to createCPUPrinter().
Builder | The builder used to emit the printer calls. |
Str | The string to be printed. |
Str
. Definition at line 19 of file RuntimeDebugBuilder.cpp.
References Str.
Referenced by createPrinter(), and polly::BlockGenerator::generateBeginStmtTrace().
|
staticprivate |
Get a reference to the 'printf' function.
If the current module does not yet contain a reference to printf, we insert a reference to it. Otherwise the existing reference is returned.
Definition at line 117 of file RuntimeDebugBuilder.cpp.
References Function, M(), and Module.
Referenced by createPrintF().
|
staticprivate |
Get (and possibly insert) a vprintf declaration into the module.
Definition at line 29 of file RuntimeDebugBuilder.cpp.
|
static |
Return whether an llvm::Value of the type Ty
is printable for debugging.
That is, whether such a value can be passed to createGPUPrinter() to be dumped as runtime. If false is returned, those functions will fail.
Definition at line 49 of file RuntimeDebugBuilder.cpp.
Referenced by polly::BlockGenerator::generateBeginStmtTrace().