1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/lib/IR
Fedor Sergeev 406a5f5b60 [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
..
AsmWriter.cpp [IR] Add a boolean field in DILocation to know if a line must covered or not 2018-09-20 08:53:06 +00:00
AttributeImpl.h
Attributes.cpp [x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative 2018-09-04 12:38:00 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [X86] Modify the the rdtscp intrinsic to return values instead of taking a pointer argument 2018-09-07 19:14:15 +00:00
BasicBlock.cpp [IR] Sink isExceptional predicate to Instruction, rename it to 2018-08-26 08:56:42 +00:00
CMakeLists.txt [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
Comdat.cpp
ConstantFold.cpp [ConstantFolding] improve folding of binops with vector undef operand 2018-08-20 18:19:02 +00:00
ConstantFold.h
ConstantRange.cpp
Constants.cpp
ConstantsContext.h
Core.cpp [LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteral 2018-09-18 01:47:37 +00:00
DataLayout.cpp [NFC] Make getPreferredAlignment honor section markings. 2018-08-29 23:46:26 +00:00
DebugInfo.cpp [C-API][DIBuilder] Use NameLen in LLVMDIBuilderCreateParameterVariable 2018-08-25 19:54:39 +00:00
DebugInfoMetadata.cpp [IR] Add a boolean field in DILocation to know if a line must covered or not 2018-09-20 08:53:06 +00:00
DebugLoc.cpp [IR] Add a boolean field in DILocation to know if a line must covered or not 2018-09-20 08:53:06 +00:00
DiagnosticHandler.cpp
DiagnosticInfo.cpp
DiagnosticPrinter.cpp
DIBuilder.cpp fix 80-column violation with clang-format 2018-09-12 22:57:28 +00:00
Dominators.cpp [DomTree] Add constructor to create a new DT based on current DT/CFG and a set of Updates. 2018-08-16 21:54:33 +00:00
DomTreeUpdater.cpp
Function.cpp Allow creating llvm::Function in non-zero address spaces 2018-08-23 09:25:17 +00:00
Globals.cpp Allow creating llvm::Function in non-zero address spaces 2018-08-23 09:25:17 +00:00
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
Instructions.cpp [IR] add shuffle query for vector concatenation 2018-09-20 15:21:52 +00:00
IntrinsicInst.cpp [DebugInfo] Refactor DbgInfoIntrinsic class hierarchy. 2018-08-06 03:59:47 +00:00
IRBuilder.cpp [SLC] Add an alignment to CreateGlobalString 2018-09-06 08:42:17 +00:00
IRPrintingPasses.cpp
LegacyPassManager.cpp Output per-function size-info remarks 2018-09-06 21:19:54 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp
LLVMContextImpl.h [IR] Add a boolean field in DILocation to know if a line must covered or not 2018-09-20 08:53:06 +00:00
Mangler.cpp
MDBuilder.cpp [Metadata] Replace a SmallVector with an array; NFC 2018-08-15 22:15:35 +00:00
Metadata.cpp
MetadataImpl.h
Module.cpp Allow creating llvm::Function in non-zero address spaces 2018-08-23 09:25:17 +00:00
ModuleSummaryIndex.cpp
Operator.cpp
OptBisect.cpp
Pass.cpp
PassInstrumentation.cpp [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
PassManager.cpp
PassRegistry.cpp
PassTimingInfo.cpp [PassTiming] reporting time-passes separately for multiple pass instances of the same pass 2018-09-04 06:12:28 +00:00
ProfileSummary.cpp
SafepointIRVerifier.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp
TypeFinder.cpp
Use.cpp
User.cpp
Value.cpp [NFC] Remove magic bool param in RAUW 2018-08-09 18:28:54 +00:00
ValueSymbolTable.cpp
Verifier.cpp Add some context to fatal verifier errors 2018-09-11 18:06:03 +00:00