[PATCH] D146283: [Passes] Add PassBuilderContext

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 03:57:39 PDT 2023


nikic created this revision.
nikic added reviewers: aeubanks, asbirlea.
Herald added subscribers: mtrofin, ormris, StephenFan, steven_wu, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Using the NewPM requires a whole bunch of magic incantations -- you need to declare all the different pass managers, register all analysis passes and cross-register the proxies. This boilerplate always looks the same.

This patch adds a PassBuilderContext, which stores both the PassBuilder and the various analysis managers, and exposes a method to perform the analysis registration. This is more convenient for most uses of PassBuilder that aren't doing anything complicated.


https://reviews.llvm.org/D146283

Files:
  llvm/include/llvm/Passes/PassBuilder.h
  llvm/lib/LTO/LTOBackend.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/lib/Passes/PassBuilderBindings.cpp
  llvm/tools/llvm-extract/llvm-extract.cpp
  llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
  llvm/tools/llvm-reduce/ReducerWorkItem.cpp
  llvm/tools/llvm-reduce/deltas/RunIRPasses.cpp
  llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp
  llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp
  llvm/unittests/Transforms/Coroutines/ExtraRematTest.cpp
  llvm/unittests/Transforms/Scalar/LICMTest.cpp
  llvm/unittests/Transforms/Utils/MemTransferLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146283.506034.patch
Type: text/x-patch
Size: 21080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/33716b06/attachment.bin>


More information about the llvm-commits mailing list