This is an archive of the discontinued LLVM Phabricator instance.

[Reassociate] Preserve AAManager and BasicAA analyses
ClosedPublic

Authored by kpolushin on Mar 31 2020, 5:18 AM.

Details

Summary

Now Reassociate Pass invalidates the analysis results of AAManager and BasicAA, but it saves GlobalsAA, although it seems that it should preserve them, since it affects only Unary and Binary operators.

Diff Detail

Event Timeline

kpolushin created this revision.Mar 31 2020, 5:18 AM

Adding potential reviewers for alias analysis.

If this is correct, a quick survey of other passes suggests that incomplete sets of "addPreserved" are probably just being copied as passes are added, so we'd do better by creating some kind of wrapper for all AA?

Can we add a regression test for this? Maybe follow the pattern of this file:
llvm-project/llvm/test/Other/optimization-remarks-invalidation.ll

In general, it's possible for a pass to preserve GlobalsAA, and not BasicAA. BasicAA depends on a number of different analysis passes, like LoopInfo, which might not be updated. GlobalsAA doesn't depend on any local analysis passes, so it's much simpler to preserve.

asbirlea accepted this revision.Apr 8 2020, 2:18 PM

IMO, this is right.
@efriedma +1.

This revision is now accepted and ready to land.Apr 8 2020, 2:18 PM

If you think this is OK, could you please land this patch?
Since I do not have permission.
Thanks.

This revision was automatically updated to reflect the committed changes.