This is an archive of the discontinued LLVM Phabricator instance.

Add an "addUsedAAAnalyses" helper function
ClosedPublic

Authored by sanjoy on Feb 8 2016, 4:40 PM.

Details

Summary

Passes that call getAnalysisIfAvailable<T> also need to call
addUsedIfAvailable<T> in getAnalysisUsage to indicate to the
legacy pass manager that it uses T. This contract was being
violated by passes that used createLegacyPMAAResults. This change
fixes this by exposing a helper in AliasAnalysis.h,
addUsedAAAnalyses, that is complementary to createLegacyPMAAResults
and does the right thing when called from getAnalysisUsage.

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 47273.Feb 8 2016, 4:40 PM
sanjoy retitled this revision from to Add an "addUsedAAAnalyses" helper function.
sanjoy updated this object.
sanjoy added a reviewer: chandlerc.
sanjoy added a subscriber: llvm-commits.
chandlerc accepted this revision.Feb 8 2016, 4:49 PM
chandlerc edited edge metadata.

LGTM, minor suggestion below.

Not a huge fan of the name, but no better ideas, and it doesn't matter much.

lib/Analysis/AliasAnalysis.cpp
568–572

Add a comment here and above indicating how these should be kept in sync? Minor.

This revision is now accepted and ready to land.Feb 8 2016, 4:49 PM
This revision was automatically updated to reflect the committed changes.