LLVM 22.0.0git
StandardInstrumentations.cpp File Reference

This file defines IR-printing pass instrumentation callbacks as well as StandardInstrumentations class that manages standard pass instrumentations. More...

Go to the source code of this file.

Classes

struct  PreservedCFGCheckerAnalysis
struct  PreservedFunctionHashAnalysis
struct  PreservedFunctionHashAnalysis::FunctionHash
struct  PreservedModuleHashAnalysis
struct  PreservedModuleHashAnalysis::ModuleHash
struct  llvm::GraphTraits< DotCfgDiffDisplayGraph * >
struct  llvm::DOTGraphTraits< DotCfgDiffDisplayGraph * >

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Functions

template<typename IRUnitT>
static const IRUnitT * unwrapIR (Any IR)
static bool shouldGenerateData (const Function &F)
static bool shouldGenerateData (const MachineFunction &MF)
static void writeIRFileDisplayName (raw_ostream &ResultStream, Any IR)
static std::string getIRFileDisplayName (Any IR)
static int prepareDumpIRFileDescriptor (const StringRef DumpIRFilename)
static void printBBName (raw_ostream &out, const BasicBlock *BB)
static SmallVector< Function *, 1 > GetFunctions (Any IR)

Variables

static cl::opt< boolVerifyAnalysisInvalidation ("verify-analysis-invalidation", cl::Hidden, cl::init(false))
static cl::opt< boolPrintChangedBefore ("print-before-changed", cl::desc("Print before passes that change them"), cl::init(false), cl::Hidden)
static cl::opt< std::stringDotBinary ("print-changed-dot-path", cl::Hidden, cl::init("dot"), cl::desc("system dot used by change reporters"))
static cl::opt< std::stringBeforeColour ("dot-cfg-before-color", cl::desc("Color for dot-cfg before elements"), cl::Hidden, cl::init("red"))
static cl::opt< std::stringAfterColour ("dot-cfg-after-color", cl::desc("Color for dot-cfg after elements"), cl::Hidden, cl::init("forestgreen"))
static cl::opt< std::stringCommonColour ("dot-cfg-common-color", cl::desc("Color for dot-cfg common elements"), cl::Hidden, cl::init("black"))
static cl::opt< std::stringDotCfgDir ("dot-cfg-dir", cl::desc("Generate dot files into specified directory for changed IRs"), cl::Hidden, cl::init("./"))
static cl::opt< std::stringPrintOnCrashPath ("print-on-crash-path", cl::desc("Print the last form of the IR before crash to a file"), cl::Hidden)
static cl::opt< boolPrintOnCrash ("print-on-crash", cl::desc("Print the last form of the IR before crash (use -print-on-crash-path to dump to a file)"), cl::Hidden)
static cl::opt< std::stringOptBisectPrintIRPath ("opt-bisect-print-ir-path", cl::desc("Print IR to path when opt-bisect-limit is reached"), cl::Hidden)
static cl::opt< boolPrintPassNumbers ("print-pass-numbers", cl::init(false), cl::Hidden, cl::desc("Print pass names and their ordinals"))
static cl::list< unsignedPrintBeforePassNumber ("print-before-pass-number", cl::CommaSeparated, cl::Hidden, cl::desc("Print IR before the passes with specified numbers as " "reported by print-pass-numbers"))
static cl::list< unsignedPrintAfterPassNumber ("print-after-pass-number", cl::CommaSeparated, cl::Hidden, cl::desc("Print IR after the passes with specified numbers as " "reported by print-pass-numbers"))
static cl::opt< std::stringIRDumpDirectory ("ir-dump-directory", cl::desc("If specified, IR printed using the " "-print-[before|after]{-all} options will be dumped into " "files in this directory rather than written to stderr"), cl::Hidden, cl::value_desc("filename"))
static cl::opt< boolDroppedVarStats ("dropped-variable-stats", cl::Hidden, cl::desc("Dump dropped debug variables stats"), cl::init(false))

Detailed Description

This file defines IR-printing pass instrumentation callbacks as well as StandardInstrumentations class that manages standard pass instrumentations.

Definition in file StandardInstrumentations.cpp.

Function Documentation

◆ GetFunctions()

SmallVector< Function *, 1 > GetFunctions ( Any IR)
static

◆ getIRFileDisplayName()

std::string getIRFileDisplayName ( Any IR)
static

Definition at line 784 of file StandardInstrumentations.cpp.

References IR, and writeIRFileDisplayName().

◆ prepareDumpIRFileDescriptor()

◆ printBBName()

◆ shouldGenerateData() [1/2]

bool shouldGenerateData ( const Function & F)
static

◆ shouldGenerateData() [2/2]

bool shouldGenerateData ( const MachineFunction & MF)
static

◆ unwrapIR()

◆ writeIRFileDisplayName()

void writeIRFileDisplayName ( raw_ostream & ResultStream,
Any IR )
static

Variable Documentation

◆ AfterColour

cl::opt< std::string > AfterColour("dot-cfg-after-color", cl::desc("Color for dot-cfg after elements"), cl::Hidden, cl::init("forestgreen")) ( "dot-cfg-after-color" ,
cl::desc("Color for dot-cfg after elements") ,
cl::Hidden ,
cl::init("forestgreen")  )
static

◆ BeforeColour

cl::opt< std::string > BeforeColour("dot-cfg-before-color", cl::desc("Color for dot-cfg before elements"), cl::Hidden, cl::init("red")) ( "dot-cfg-before-color" ,
cl::desc("Color for dot-cfg before elements") ,
cl::Hidden ,
cl::init("red")  )
static

◆ CommonColour

cl::opt< std::string > CommonColour("dot-cfg-common-color", cl::desc("Color for dot-cfg common elements"), cl::Hidden, cl::init("black")) ( "dot-cfg-common-color" ,
cl::desc("Color for dot-cfg common elements") ,
cl::Hidden ,
cl::init("black")  )
static

◆ DotBinary

cl::opt< std::string > DotBinary("print-changed-dot-path", cl::Hidden, cl::init("dot"), cl::desc("system dot used by change reporters")) ( "print-changed-dot-path" ,
cl::Hidden ,
cl::init("dot") ,
cl::desc("system dot used by change reporters")  )
static

◆ DotCfgDir

cl::opt< std::string > DotCfgDir("dot-cfg-dir", cl::desc("Generate dot files into specified directory for changed IRs"), cl::Hidden, cl::init("./")) ( "dot-cfg-dir" ,
cl::desc("Generate dot files into specified directory for changed IRs") ,
cl::Hidden ,
cl::init("./")  )
static

◆ DroppedVarStats

cl::opt< bool > DroppedVarStats("dropped-variable-stats", cl::Hidden, cl::desc("Dump dropped debug variables stats"), cl::init(false)) ( "dropped-variable-stats" ,
cl::Hidden ,
cl::desc("Dump dropped debug variables stats") ,
cl::init(false)  )
static

◆ IRDumpDirectory

cl::opt< std::string > IRDumpDirectory("ir-dump-directory", cl::desc("If specified, IR printed using the " "-print-[before|after]{-all} options will be dumped into " "files in this directory rather than written to stderr"), cl::Hidden, cl::value_desc("filename")) ( "ir-dump-directory" ,
cl::desc("If specified, IR printed using the " "-print-[before|after]{-all} options will be dumped into " "files in this directory rather than written to stderr") ,
cl::Hidden ,
cl::value_desc("filename")  )
static

◆ OptBisectPrintIRPath

cl::opt< std::string > OptBisectPrintIRPath("opt-bisect-print-ir-path", cl::desc("Print IR to path when opt-bisect-limit is reached"), cl::Hidden) ( "opt-bisect-print-ir-path" ,
cl::desc("Print IR to path when opt-bisect-limit is reached") ,
cl::Hidden  )
static

◆ PrintAfterPassNumber

cl::list< unsigned > PrintAfterPassNumber("print-after-pass-number", cl::CommaSeparated, cl::Hidden, cl::desc("Print IR after the passes with specified numbers as " "reported by print-pass-numbers")) ( "print-after-pass-number" ,
cl::CommaSeparated ,
cl::Hidden ,
cl::desc("Print IR after the passes with specified numbers as " "reported by print-pass-numbers")  )
static

◆ PrintBeforePassNumber

cl::list< unsigned > PrintBeforePassNumber("print-before-pass-number", cl::CommaSeparated, cl::Hidden, cl::desc("Print IR before the passes with specified numbers as " "reported by print-pass-numbers")) ( "print-before-pass-number" ,
cl::CommaSeparated ,
cl::Hidden ,
cl::desc("Print IR before the passes with specified numbers as " "reported by print-pass-numbers")  )
static

◆ PrintChangedBefore

cl::opt< bool > PrintChangedBefore("print-before-changed", cl::desc("Print before passes that change them"), cl::init(false), cl::Hidden) ( "print-before-changed" ,
cl::desc("Print before passes that change them") ,
cl::init(false) ,
cl::Hidden  )
static

◆ PrintOnCrash

cl::opt< bool > PrintOnCrash("print-on-crash", cl::desc("Print the last form of the IR before crash (use -print-on-crash-path to dump to a file)"), cl::Hidden) ( "print-on-crash" ,
cl::desc("Print the last form of the IR before crash (use -print-on-crash-path to dump to a file)") ,
cl::Hidden  )
static

◆ PrintOnCrashPath

cl::opt< std::string > PrintOnCrashPath("print-on-crash-path", cl::desc("Print the last form of the IR before crash to a file"), cl::Hidden) ( "print-on-crash-path" ,
cl::desc("Print the last form of the IR before crash to a file") ,
cl::Hidden  )
static

◆ PrintPassNumbers

cl::opt< bool > PrintPassNumbers("print-pass-numbers", cl::init(false), cl::Hidden, cl::desc("Print pass names and their ordinals")) ( "print-pass-numbers" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Print pass names and their ordinals")  )
static

◆ VerifyAnalysisInvalidation

cl::opt< bool > VerifyAnalysisInvalidation("verify-analysis-invalidation", cl::Hidden, cl::init(false)) ( "verify-analysis-invalidation" ,
cl::Hidden ,
cl::init(false)  )
static