llvm-mirror/unittests
Fedor Sergeev 817b214094 [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.

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

llvm-svn: 342597
2018-09-19 22:42:57 +00:00
..
ADT Fix -Wsign-compare warnings. NFCI 2018-09-19 14:52:34 +00:00
Analysis [New PM] Introducing PassInstrumentation framework 2018-09-19 22:42:57 +00:00
AsmParser Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
BinaryFormat Fix comparison of char and int64 in TestWriteFixNegativeInt 2018-08-23 07:12:05 +00:00
Bitcode Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
CodeGen Move init code in AArch64SelectionDAGTest to SetUpTestCase (NFC) 2018-09-06 18:40:35 +00:00
DebugInfo Fix function signature to actually be an override. 2018-09-18 16:58:17 +00:00
Demangle Attempt to fix some MSVC build errors. 2018-08-13 17:39:19 +00:00
ExecutionEngine [ORC] Add a special 'main' JITDylib that is created on ExecutionSession 2018-09-12 21:48:59 +00:00
FuzzMutate [FuzzMutate] Inst deleter doesn't work with PhiNodes 2018-01-25 09:22:18 +00:00
IR [New PM] Introducing PassInstrumentation framework 2018-09-19 22:42:57 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Inline a few CMake variables into their only uses. 2018-05-14 19:23:31 +00:00
MC [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
MI [LiveIntervals] Handle moving up dead partial write 2018-02-26 14:42:13 +00:00
Object Fix unittest for buildbot with mips host (32bit big endian) from r295174 2017-02-15 16:03:22 +00:00
ObjectYAML Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
Option Revert r341329 due to MSAN error 2018-09-03 18:13:46 +00:00
Passes Revert "[cmake] Fix a unittest when LLVM_LINK_LLVM_DYLIB is requested." 2018-09-13 20:24:36 +00:00
ProfileData Use createTemporaryFile in SampleProfTest 2018-09-17 12:11:01 +00:00
Support Remove dead function user_cache_directory() 2018-09-18 15:06:16 +00:00
Target [WebAssembly] Add WebAssemblyException information analysis 2018-06-25 01:20:21 +00:00
tools Revert rL342465: Added function to set a register to a particular value + tests. 2018-09-18 15:38:16 +00:00
Transforms [New PM] Introducing PassInstrumentation framework 2018-09-19 22:42:57 +00:00
XRay Fix the build when LLVM_TARGETS_TO_BUILD is empty. 2018-09-19 21:36:26 +00:00
CMakeLists.txt Introduce explicit add_unittest_with_input_files target for tests that use llvm::getInputFileDirectory() 2018-09-14 17:34:46 +00:00
unittest.cfg.in Add support for unittest inputs. 2018-09-05 23:30:17 +00:00