[PM/AA] Teach the new pass manager to use pass-by-lambda for registering
authorChandler Carruth <chandlerc@gmail.com>
Thu, 18 Feb 2016 09:45:17 +0000 (09:45 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 18 Feb 2016 09:45:17 +0000 (09:45 +0000)
commitedf5996b061b0fc046befdcf7a64740ea8197a99
tree17823d8031bfaef3add8d759b2d94935791286b8
parent7cdb72f7ea386dec40b1a80e44d01b60c9717822
[PM/AA] Teach the new pass manager to use pass-by-lambda for registering
analysis passes, support pre-registering analyses, and use that to
implement parsing and pre-registering a custom alias analysis pipeline.

With this its possible to configure the particular alias analysis
pipeline used by the AAManager from the commandline of opt. I've updated
the test to show this effectively in use to build a pipeline including
basic-aa as part of it.

My big question for reviewers are around the APIs that are used to
expose this functionality. Are folks happy with pass-by-lambda to do
pass registration? Are folks happy with pre-registering analyses as
a way to inject customized instances of an analysis while still using
the registry for the general case?

Other thoughts of course welcome. The next round of patches will be to
add the rest of the alias analyses into the new pass manager and wire
them up here so that they can be used from opt. This will require
extending the (somewhate limited) functionality of AAManager w.r.t.
module passes.

Differential Revision: http://reviews.llvm.org/D17259

llvm-svn: 261197
llvm/include/llvm/IR/PassManager.h
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/test/Other/new-pass-manager.ll
llvm/tools/opt/NewPMDriver.cpp
llvm/unittests/IR/PassManagerTest.cpp