[PATCH] D60914: [AliasAnalysis] AAResults preserves AAManager.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 19 12:23:02 PDT 2019
asbirlea created this revision.
asbirlea added a reviewer: chandlerc.
Herald added subscribers: jlebar, mehdi_amini.
Herald added a project: LLVM.
AAResults should not invalidate AAManager.
Update tests.
Repository:
rL LLVM
https://reviews.llvm.org/D60914
Files:
lib/Analysis/AliasAnalysis.cpp
test/Analysis/MemoryDependenceAnalysis/invalidation.ll
test/Other/new-pass-manager.ll
unittests/Transforms/Scalar/LoopPassManagerTest.cpp
Index: unittests/Transforms/Scalar/LoopPassManagerTest.cpp
===================================================================
--- unittests/Transforms/Scalar/LoopPassManagerTest.cpp
+++ unittests/Transforms/Scalar/LoopPassManagerTest.cpp
@@ -572,7 +572,6 @@
// invalidation and running.
EXPECT_CALL(MFPHandle, run(HasName("f"), _))
.WillOnce(Return(getLoopPassPreservedAnalyses()));
- EXPECT_CALL(MLAHandle, invalidate(_, _, _)).Times(3);
EXPECT_CALL(MLAHandle, run(HasName("loop.0.0"), _, _));
EXPECT_CALL(MLAHandle, run(HasName("loop.0.1"), _, _));
EXPECT_CALL(MLAHandle, run(HasName("loop.0"), _, _));
Index: test/Other/new-pass-manager.ll
===================================================================
--- test/Other/new-pass-manager.ll
+++ test/Other/new-pass-manager.ll
@@ -355,13 +355,11 @@
; CHECK-AA-MODULE-INVALIDATE: Running analysis: AAManager
; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
; CHECK-AA-MODULE-INVALIDATE: Running pass: InvalidateAnalysisPass
-; CHECK-AA-MODULE-INVALIDATE: Invalidating analysis: AAManager
; CHECK-AA-MODULE-INVALIDATE: Invalidating analysis: GlobalsAA
; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
; CHECK-AA-MODULE-INVALIDATE: Running pass: AAEvaluator
-; CHECK-AA-MODULE-INVALIDATE: Running analysis: AAManager
; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Module pass manager run
Index: test/Analysis/MemoryDependenceAnalysis/invalidation.ll
===================================================================
--- test/Analysis/MemoryDependenceAnalysis/invalidation.ll
+++ test/Analysis/MemoryDependenceAnalysis/invalidation.ll
@@ -1,17 +1,16 @@
; Test that memdep gets invalidated when the analyses it depends on are
; invalidated.
;
-; Check AA specifically.
+; Check AA. AA is stateless, there's nothing to invalidate.
; RUN: opt -disable-output -debug-pass-manager -aa-pipeline='basic-aa' %s 2>&1 \
; RUN: -passes='require<memdep>,invalidate<aa>,gvn' \
; RUN: | FileCheck %s --check-prefix=CHECK-AA-INVALIDATE
; CHECK-AA-INVALIDATE: Running pass: RequireAnalysisPass
; CHECK-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis
; CHECK-AA-INVALIDATE: Running pass: InvalidateAnalysisPass
-; CHECK-AA-INVALIDATE: Invalidating analysis: AAManager
-; CHECK-AA-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis
+; CHECK-NOT-AA-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis
; CHECK-AA-INVALIDATE: Running pass: GVN
-; CHECK-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis
+; CHECK-NOT-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis
;
; Check domtree specifically.
; RUN: opt -disable-output -debug-pass-manager %s 2>&1 \
Index: lib/Analysis/AliasAnalysis.cpp
===================================================================
--- lib/Analysis/AliasAnalysis.cpp
+++ lib/Analysis/AliasAnalysis.cpp
@@ -79,10 +79,8 @@
bool AAResults::invalidate(Function &F, const PreservedAnalyses &PA,
FunctionAnalysisManager::Invalidator &Inv) {
- // Check if the AA manager itself has been invalidated.
- auto PAC = PA.getChecker<AAManager>();
- if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<Function>>())
- return true; // The manager needs to be blown away, clear everything.
+ // AAResults preserves the AAManager by default, due to the stateless nature
+ // of AliasAnalysis. Do not invalidate it here.
// Check all of the dependencies registered.
for (AnalysisKey *ID : AADeps)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60914.195898.patch
Type: text/x-patch
Size: 3725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190419/1ae99009/attachment.bin>
More information about the llvm-commits
mailing list