This is an archive of the discontinued LLVM Phabricator instance.

[AA] Enhance the new AliasAnalysis infrastructure with an optional "external" AA wrapper pass.
ClosedPublic

Authored by chandlerc on Oct 3 2015, 7:19 PM.

Details

Summary

This is a generic hook that can be used to thread custom code into the
primary AAResultsWrapperPass for the legacy pass manager in order to
allow it to merge external AA results into the AA results it is
building. It does this by threading in a raw callback and so it is
*very* powerful and should serve almost any use case I have come up with
for extending the set of alias analyses used. The only thing not well
supported here is using a *different order* of alias analyses. That form
of extension *is* supportable with the new pass manager, and I can make
the callback structure here more elaborate to support it in the legacy
pass manager if this is a critical use case that people are already
depending on, but the only use cases I have heard of thus far should be
reasonably satisfied by this simpler extension mechanism.

It is hard to test this using normal facilities (the built-in AAs don't
use this for obvious reasons) so I've written a fairly extensive set of
custom passes in the alias analysis unit test that should be an
excellent test case because it models the out-of-tree users: it adds
a totally custom AA to the system. This should also serve as
a reasonably good example and guide for out-of-tree users to follow in
order to rig up their existing alias analyses.

No support in opt for commandline control is provided here however. I'm
really unhappy with the kind of contortions that would be required to
support that. It would fully re-introduce the analysis group
self-recursion kind of patterns. =/

Hopefully this is sufficient for the existing out-of-tree users to be
unblocked and able to use the AA infrastructure after the removal of
analysis group functionality.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc updated this revision to Diff 36454.Oct 3 2015, 7:19 PM
chandlerc retitled this revision from to [AA] Enhance the new AliasAnalysis infrastructure with an optional "external" AA wrapper pass..
chandlerc updated this object.
chandlerc added reviewers: gottesmm, hfinkel.
chandlerc added a subscriber: llvm-commits.
gottesmm edited edge metadata.Oct 19 2015, 2:49 PM

I just prepared all of the code that I need internally to work with this and it enables me to work through/verify all my use cases. This LGTM! Thanks Chandler!

gottesmm accepted this revision.Oct 19 2015, 2:52 PM
gottesmm edited edge metadata.
This revision is now accepted and ready to land.Oct 19 2015, 2:52 PM
This revision was automatically updated to reflect the committed changes.