1 ; Test that access-info gets invalidated when the analyses it depends on are
4 ; This is a reproducer for https://github.com/llvm/llvm-project/issues/61324.
5 ; We want to see that LoopAccessAnalysis+AAManger is being updated at the end,
6 ; instead of crashing when using a stale AAManager.
8 ; RUN: opt < %s -disable-output -debug-pass-manager -passes='function(require<access-info>,invalidate<aa>),print<access-info>' 2>&1 | FileCheck %s --check-prefix=CHECK-AA
10 ; CHECK-AA: Running pass: RequireAnalysisPass
11 ; CHECK-AA-NEXT: Running analysis: LoopAccessAnalysis on foo
12 ; CHECK-AA: Running pass: InvalidateAnalysisPass
13 ; CHECK-AA-NEXT: Invalidating analysis: AAManager on foo
14 ; CHECK-AA-NEXT: Invalidating analysis: LoopAccessAnalysis on foo
15 ; CHECK-AA-NEXT: Running pass: LoopAccessInfoPrinterPass on foo
16 ; CHECK-AA-NEXT: Running analysis: LoopAccessAnalysis on foo
17 ; CHECK-AA-NEXT: Running analysis: AAManager on foo
20 ; Verify that an explicit invalidate request for access-info result in an
23 ; RUN: opt < %s -disable-output -debug-pass-manager -passes='function(require<access-info>,invalidate<access-info>)' 2>&1 | FileCheck %s --check-prefix=CHECK-INV-AA
25 ; CHECK-INV-AA: Running pass: RequireAnalysisPass
26 ; CHECK-INV-AA-NEXT: Running analysis: LoopAccessAnalysis on foo
27 ; CHECK-INV-AA: Running pass: InvalidateAnalysisPass
28 ; CHECK-INV-AA-NEXT: Invalidating analysis: LoopAccessAnalysis on foo
31 ; Invalidation of scalar-evolution should transitively invalidate access-info.
33 ; RUN: opt < %s -disable-output -debug-pass-manager -passes='function(require<access-info>,invalidate<scalar-evolution>)' 2>&1 | FileCheck %s --check-prefix=CHECK-SCEV
35 ; CHECK-SCEV: Running pass: RequireAnalysisPass
36 ; CHECK-SCEV-NEXT: Running analysis: LoopAccessAnalysis on foo
37 ; CHECK-SCEV: Running pass: InvalidateAnalysisPass
38 ; CHECK-SCEV-NEXT: Invalidating analysis: ScalarEvolutionAnalysis on foo
39 ; CHECK-SCEV-NEXT: Invalidating analysis: LoopAccessAnalysis on foo
42 ; Invalidation of domtree should transitively invalidate access-info.
44 ; RUN: opt < %s -disable-output -debug-pass-manager -passes='function(require<access-info>,invalidate<domtree>)' 2>&1 | FileCheck %s --check-prefix=CHECK-DT
46 ; CHECK-DT: Running pass: RequireAnalysisPass
47 ; CHECK-DT-NEXT: Running analysis: LoopAccessAnalysis on foo
48 ; CHECK-DT: Running pass: InvalidateAnalysisPass
49 ; CHECK-DT-NEXT: Invalidating analysis: DominatorTreeAnalysis on foo
50 ; CHECK-DT: Invalidating analysis: LoopAccessAnalysis on foo
53 define void @foo(ptr nocapture writeonly %a, ptr nocapture writeonly %b) memory(argmem: write) {
58 store i16 0, ptr %b, align 1
59 store i16 0, ptr %a, align 1
60 br i1 true, label %for.end6, label %for.cond1