[PATCH] D33464: [PM][WIP] Enable out-of-tree registration of passes with the new PassBuilder

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 14:48:52 PDT 2017


philip.pfaffe created this revision.
Herald added a subscriber: mgorny.

This is approach tries different angle towards plugin pass registration.

Through the HookManager API, out-of-tree 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 I've provided a helper for that.

I've marked this patch WIP because there is one key element missing currently, which is automatically detecting the type of a pipeline given just a pass name. I've yet to come up with a nice solution here. Obvious options are either adding another callback insertion point here, or registering the set of available names (with their IRUnit type); neither of which I don't like to much. I'm happy about suggestions.


Repository:
  rL LLVM

https://reviews.llvm.org/D33464

Files:
  include/llvm/Passes/PassBuilder.h
  lib/Passes/PassBuilder.cpp
  unittests/IR/CMakeLists.txt
  unittests/IR/HookManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33464.99999.patch
Type: text/x-patch
Size: 32733 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170523/a04fb0f0/attachment.bin>


More information about the llvm-commits mailing list