llvm-project/llvm/lib
Fedor Sergeev ee8d31c49e [New PM] Introducing PassInstrumentation framework
Pass Execution Instrumentation interface enables customizable instrumentation
of pass execution, as per "RFC: Pass Execution Instrumentation interface"
posted 06/07/2018 on llvm-dev@

The intent is to provide a common machinery to implement all
the pass-execution-debugging features like print-before/after,
opt-bisect, time-passes etc.

Here we get a basic implementation consisting of:
* PassInstrumentationCallbacks class that handles registration of callbacks
  and access to them.

* PassInstrumentation class that handles instrumentation-point interfaces
  that call into PassInstrumentationCallbacks.

* Callbacks accept StringRef which is just a name of the Pass right now.
  There were some ideas to pass an opaque wrapper for the pointer to pass instance,
  however it appears that pointer does not actually identify the instance
  (adaptors and managers might have the same address with the pass they govern).
  Hence it was decided to go simple for now and then later decide on what the proper
  mental model of identifying a "pass in a phase of pipeline" is.

* Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies
  on different IRUnits (e.g. Analyses).

* PassInstrumentationAnalysis analysis is explicitly requested from PassManager through
  usual AnalysisManager::getResult. All pass managers were updated to run that
  to get PassInstrumentation object for instrumentation calls.

* Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra
  args out of a generic PassManager's extra args. This is the only way I was able to explicitly
  run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or
  RepeatedPass::run.
  TODO: Upon lengthy discussions we agreed to accept this as an initial implementation
  and then get rid of getAnalysisResult by improving RepeatedPass implementation.

* PassBuilder takes PassInstrumentationCallbacks object to pass it further into
  PassInstrumentationAnalysis. Callbacks registration should be performed directly
  through PassInstrumentationCallbacks.

* new-pm tests updated to account for PassInstrumentationAnalysis being run

* Added PassInstrumentation tests to PassBuilderCallbacks unit tests.
  Other unit tests updated with registration of the now-required PassInstrumentationAnalysis.

  Made getName helper to return std::string (instead of StringRef initially) to fix
  asan builtbot failures on CGSCC tests.

Reviewers: chandlerc, philip.pfaffe
Differential Revision: https://reviews.llvm.org/D47858

llvm-svn: 342664
2018-09-20 17:08:45 +00:00
..
Analysis [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
AsmParser [IR] Add a boolean field in DILocation to know if a line must covered or not 2018-09-20 08:53:06 +00:00
BinaryFormat [WebAssembly] clang-format (NFC) 2018-09-05 01:27:38 +00:00
Bitcode [IR] Add a boolean field in DILocation to know if a line must covered or not 2018-09-20 08:53:06 +00:00
CodeGen [DWARF] - Emit the correct value for DW_AT_addr_base. 2018-09-20 09:17:36 +00:00
DebugInfo [PDB] Better printing of builtin types when using DIA dumper. 2018-09-20 16:12:05 +00:00
Demangle Update microsoftDemangle() to work more like itaniumDemangle(). 2018-09-15 18:24:20 +00:00
ExecutionEngine [ORC] Merge ExecutionSessionBase with ExecutionSession by moving a couple of 2018-09-12 21:49:02 +00:00
FuzzMutate [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
Fuzzer
IR [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
IRReader
LTO [ThinLTOCodeGenerator] Avoid Rehash StringMap in ThreadPool 2018-09-14 19:38:21 +00:00
LineEditor
Linker [NFC] Remove an empty line. 2018-07-27 06:50:45 +00:00
MC Fix for bug 34002 - label generated before it block is finalized. Differential Revision: https://reviews.llvm.org/D52258 2018-09-20 05:11:42 +00:00
Object [object] Improve the performance of getSymbols used by ArchiveWriter 2018-09-11 22:00:47 +00:00
ObjectYAML [PDB] Write FPO Data to the PDB. 2018-09-11 22:35:01 +00:00
Option Revert r341329 due to MSAN error 2018-09-03 18:13:46 +00:00
Passes [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
ProfileData [gcov] Fix wrong line hit counts when multiple blocks are on the same line 2018-09-20 16:09:30 +00:00
Support Remove dead function user_cache_directory() 2018-09-18 15:06:16 +00:00
TableGen Remove trailing space 2018-07-30 19:41:25 +00:00
Target [X86][SSE] Remove UNPCKL(SHUFFLE)->UNPCKH custom combine 2018-09-20 13:10:22 +00:00
Testing Fix error with SmallString implicit conversion. 2018-09-06 22:47:32 +00:00
ToolDrivers Give llvm-lib rudimentary help output. 2018-07-14 02:29:44 +00:00
Transforms [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] Bug fixes for FDR custom event and arg-logging 2018-09-13 09:25:42 +00:00
CMakeLists.txt
LLVMBuild.txt