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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.
If you think this is OK, could you please land this patch?
Since I do not have permission.
Thanks.