]> granicus.if.org Git - llvm/commit
[PM] Enable registration of out-of-tree passes with PassBuilder
authorPhilip Pfaffe <philip.pfaffe@gmail.com>
Mon, 10 Jul 2017 10:57:55 +0000 (10:57 +0000)
committerPhilip Pfaffe <philip.pfaffe@gmail.com>
Mon, 10 Jul 2017 10:57:55 +0000 (10:57 +0000)
commit19045617b35798b2cb1fcd46c8262bb44f40ca06
tree4e67dde91b5996f0a4023e262f9a4727b6bd9da3
parente9e97c867a15ee21577b677f736dc0fdf3f9e39c
[PM] Enable registration of out-of-tree passes with PassBuilder

Summary:
This patch adds a callback registration API to the PassBuilder,
enabling registering out-of-tree passes with it.

Through the Callback API, callers may register callbacks with the
various stages at which passes are added into pass managers, including
parsing of a pass pipeline as well as at extension points within the
default -O pipelines.

Registering utilities like `require<>` and `invalidate<>` needs to be
handled manually by the caller, but a helper is provided.

Additionally, adding passes at pipeline extension points is exposed
through the opt tool. This patch adds a `-passes-ep-X` commandline
option for every extension point X, which opt parses into pipelines
inserted into that extension point.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: lksbhm, grosser, davide, mehdi_amini, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D33464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307532 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Passes/PassBuilder.h
lib/Passes/PassBuilder.cpp
test/Other/new-pm-defaults.ll
test/Other/new-pm-lto-defaults.ll
tools/opt/NewPMDriver.cpp
unittests/IR/CMakeLists.txt
unittests/IR/PassBuilderCallbacksTest.cpp [new file with mode: 0644]