[LAA] Fix transitive analysis invalidation bug by implementing LoopAccessInfoManager...
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Thu, 16 Mar 2023 01:00:47 +0000 (02:00 +0100)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Fri, 17 Mar 2023 08:33:16 +0000 (09:33 +0100)
commit81d6310da1fc54f0ca0de6fa13246d6071edb0cf
treeedd9a5e8fe4af4251f7b9eba4755b178a6a1a66f
parentfed4e7d0d2a45b1e49998054379af94d1ba43edd
[LAA] Fix transitive analysis invalidation bug by implementing LoopAccessInfoManager::invalidate

The default invalidate method for analysis results is just looking
at the preserved state of the pass itself. It does not consider if
the analysis has an internal state that depend on other analyses.
Thus, we need to implement LoopAccessInfoManager::invalidate in order
to catch if LoopAccessAnalysis needs to be invalidated due to
transitive analyses such as AAManager is being invalidated. Otherwise
we might end up having references to an AAManager that is stale.

Fixes https://github.com/llvm/llvm-project/issues/61324

Differential Revision: https://reviews.llvm.org/D146206
llvm/include/llvm/Analysis/LoopAccessAnalysis.h
llvm/lib/Analysis/LoopAccessAnalysis.cpp
llvm/test/Analysis/LoopAccessAnalysis/invalidation.ll [new file with mode: 0644]