OSDN Git Service

[PM] Add a utility pass template that synthesizes the invalidation of
authorChandler Carruth <chandlerc@gmail.com>
Tue, 6 Jan 2015 04:49:44 +0000 (04:49 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 6 Jan 2015 04:49:44 +0000 (04:49 +0000)
commit17395fa733494da19b3931c2957b870da78aa0b7
treefc03e546524528931d0558d06455d6a0735e1f62
parent7e6723e35694b3419a9d580f269d1db2f8cd10fd
[PM] Add a utility pass template that synthesizes the invalidation of
a specific analysis result.

This is quite handy to test things, and will also likely be very useful
for debugging issues. You could narrow down pass validation failures by
walking these invalidate pass runs up and down the pass pipeline, etc.
I've added support to the pass pipeline parsing to be able to create one
of these for any analysis pass desired.

Just adding this class uncovered one latent bug where the
AnalysisManager CRTP base class had a hard-coded Module type rather than
using IRUnitT.

I've also added tests for invalidation and caching of analyses in
a basic way across all the pass managers. These in turn uncovered two
more bugs where we failed to correctly invalidate an analysis -- its
results were invalidated but the key for re-running the pass was never
cleared and so it was never re-run. Quite nasty. I'm very glad to debug
this here rather than with a full system.

Also, yes, the naming here is horrid. I'm going to update some of the
names to be slightly less awful shortly. But really, I've no "good"
ideas for naming. I'll be satisfied if I can get it to "not bad".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225246 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/PassManager.h
lib/Analysis/CGSCCPassManager.cpp
lib/IR/PassManager.cpp
test/Other/new-pass-manager.ll
tools/opt/Passes.cpp