This is an archive of the discontinued LLVM Phabricator instance.

[AliasAnalysis/NewPassManager] Invalidate AAManager less often.
ClosedPublic

Authored by asbirlea on Apr 29 2019, 4:40 PM.

Details

Summary

This is a redo of D60914.

The objective is to not invalidate AAManager, which is stateless, unless
there is an explicit invalidate in one of the AAResults.

To achieve this, this patch adds an API to PAC, to check precisely this:
is this analysis not invalidated explicitly == is this analysis not abandoned == is this analysis stateless, so preserved without explicitly being marked as preserved by everyone

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.Apr 29 2019, 4:40 PM
chandlerc accepted this revision.Apr 29 2019, 5:29 PM

LGTM, very nice! Thanks for all the work tracking down this subtle case!

I've left some tiny suggestions below, but feel free to submit.

include/llvm/Analysis/AliasAnalysis.h
1104 ↗(On Diff #197219)

stray blank line?

include/llvm/IR/PassManager.h
289–291 ↗(On Diff #197219)

Make a doxygen comment?

lib/Analysis/AliasAnalysis.cpp
86–89 ↗(On Diff #197219)

I'd move everything before the "However" to a comment on the PAC line. The rest makes sense here.

This revision is now accepted and ready to land.Apr 29 2019, 5:29 PM
This revision was automatically updated to reflect the committed changes.