llvm-project/llvm/unittests/Analysis
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
..
AliasAnalysisTest.cpp llvm: Add support for "-fno-delete-null-pointer-checks" 2018-07-09 22:27:23 +00:00
AliasSetTrackerTest.cpp [AST] Fix a bug in aliasesUnknownInst. Make sure we are comparing the unknown instructions in the alias set and the instruction interested in. 2017-06-25 12:55:11 +00:00
BlockFrequencyInfoTest.cpp [BFI] Use rounding while computing profile counts. 2018-08-16 00:26:59 +00:00
BranchProbabilityInfoTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
CFGTest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
CGSCCPassManagerTest.cpp [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
CMakeLists.txt Rename a few unittests/.../Foo.cpp files to FooTest.cpp 2018-09-03 12:43:26 +00:00
CallGraphTest.cpp
GlobalsModRefTest.cpp GlobalsModRef: Ensure optnone+readonly/readnone attributes are respected 2017-06-07 21:37:39 +00:00
LazyCallGraphTest.cpp [unittests] Change std::sort to llvm::sort in response to r327219 2018-04-07 01:29:45 +00:00
LoopInfoTest.cpp [LoopInfo][FIX] Remove leftover dump in unit test 2018-09-11 17:49:43 +00:00
MemoryBuiltinsTest.cpp
MemorySSATest.cpp API to update MemorySSA for cloned blocks and added CFG edges. 2018-09-10 20:13:01 +00:00
OrderedBasicBlockTest.cpp [OrderedBasicBlock] Return false for comesBefore(A, A) 2017-06-02 13:10:31 +00:00
OrderedInstructionsTest.cpp Rename a few unittests/.../Foo.cpp files to FooTest.cpp 2018-09-03 12:43:26 +00:00
PhiValuesTest.cpp [PhiValues] Adjust unit test to invalidate instructions before deleting them 2018-06-28 15:17:07 +00:00
ProfileSummaryInfoTest.cpp Remove redundant includes from unittests. 2017-12-13 21:31:05 +00:00
ScalarEvolutionTest.cpp [SCEV] Do not cache S -> V if S is not equivalent of V 2018-01-09 06:47:14 +00:00
SparsePropagation.cpp [SparsePropagation] Enable interprocedural analysis 2017-10-16 17:44:17 +00:00
TBAATest.cpp Re-sort #include lines for unittests. This uses a slightly modified 2017-06-06 11:06:56 +00:00
TargetLibraryInfoTest.cpp [SimplifyLibcalls] Replace locked IO with unlocked IO 2018-05-16 11:39:52 +00:00
UnrollAnalyzerTest.cpp Rename a few unittests/.../Foo.cpp files to FooTest.cpp 2018-09-03 12:43:26 +00:00
ValueLatticeTest.cpp [ValueLattice] Return false if value range did not change in mergeIn. 2018-06-27 12:57:51 +00:00
ValueTrackingTest.cpp Infer lowest bits of an integer Multiply when the low bits of the operands are known 2017-12-09 23:25:57 +00:00