[BasicAA] Drop dependency on Loop Info. PR43276
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 17 Mar 2021 04:16:07 +0000 (11:16 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Wed, 17 Mar 2021 04:43:44 +0000 (11:43 +0700)
commita6074b092cd526c1a5c4dc4237ee867a65339cbf
tree98b07fe43555fd010a2e5916267df4c5a8c40582
parentdb1e845a9646fb191109588ad58ee9ea6ea160a2
[BasicAA] Drop dependency on Loop Info. PR43276

BasicAA stores a reference to LoopInfo inside. This imposes an implicit
requirement of keeping it up to date whenever we modify the IR (in particular,
whenever we modify terminators of blocks that belong to loops). Failing
to do so leads to incorrect state of the LoopInfo.

Because general AA does not require loop info updates and provides to API to
update it properly, the users of AA reasonably assume that there is no need to
update the loop info. It may be a reason of bugs, as example in PR43276 shows.

This patch drops dependence of BasicAA on LoopInfo to avoid this problem.

This may potentially pessimize the result of queries to BasicAA.

Differential Revision: https://reviews.llvm.org/D98627
Reviewed By: nikic
llvm/include/llvm/Analysis/BasicAliasAnalysis.h
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/invalidation.ll
llvm/test/Transforms/JumpThreading/pr43276.ll [new file with mode: 0644]
llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp