Lines Matching defs:pass
34 void runBeforePass(Pass *pass, Operation *op) override;
35 void runAfterPass(Pass *pass, Operation *op) override;
36 void runAfterPassFailed(Pass *pass, Operation *op) override;
42 /// being operated on in a pass. This field is only used when the
70 void IRPrinterInstrumentation::runBeforePass(Pass *pass, Operation *op) {
71 if (isa<OpToOpPassAdaptor>(pass))
75 beforePassFingerPrints.try_emplace(pass, op);
77 config->printBeforeIfEnabled(pass, op, [&](raw_ostream &out) {
78 out << "// -----// IR Dump Before " << pass->getName() << " ("
79 << pass->getArgument() << ")";
86 void IRPrinterInstrumentation::runAfterPass(Pass *pass, Operation *op) {
87 if (isa<OpToOpPassAdaptor>(pass))
97 auto fingerPrintIt = beforePassFingerPrints.find(pass);
108 config->printAfterIfEnabled(pass, op, [&](raw_ostream &out) {
109 out << "// -----// IR Dump After " << pass->getName() << " ("
110 << pass->getArgument() << ")";
117 void IRPrinterInstrumentation::runAfterPassFailed(Pass *pass, Operation *op) {
118 if (isa<OpToOpPassAdaptor>(pass))
121 beforePassFingerPrints.erase(pass);
123 config->printAfterIfEnabled(pass, op, [&](raw_ostream &out) {
124 out << formatv("// -----// IR Dump After {0} Failed ({1})", pass->getName(),
125 pass->getArgument());
148 /// of 'operation' should be dumped *before* the pass 'pass' has been
152 Pass *pass, Operation *operation, PrintCallbackFn printCallback) {
157 /// of 'operation' should be dumped *after* the pass 'pass' has been
161 Pass *pass, Operation *operation, PrintCallbackFn printCallback) {
186 void printBeforeIfEnabled(Pass *pass, Operation *operation,
188 if (shouldPrintBeforePass && shouldPrintBeforePass(pass, operation))
192 void printAfterIfEnabled(Pass *pass, Operation *operation,
194 if (shouldPrintAfterPass && shouldPrintAfterPass(pass, operation))
198 /// Filter functions for before and after pass execution.
261 // structure of the pass manager, using symbol names for directory names.
290 /// A configuration that prints the IR before/after each pass to a set of files
309 void printBeforeIfEnabled(Pass *pass, Operation *operation,
311 if (!shouldPrintBeforePass || !shouldPrintBeforePass(pass, operation))
314 operation, pass->getArgument(), treeDir, counters);
321 void printAfterIfEnabled(Pass *pass, Operation *operation,
323 if (!shouldPrintAfterPass || !shouldPrintAfterPass(pass, operation))
326 operation, pass->getArgument(), treeDir, counters);
333 /// Filter functions for before and after pass execution.
341 /// a pass gets its own counter.
347 /// Add an instrumentation to print the IR before and after pass execution,
352 llvm::report_fatal_error("IR printing can't be setup on a pass-manager "
358 /// Add an instrumentation to print the IR before and after pass execution.
371 /// Add an instrumentation to print the IR before and after pass execution.