1 ; Test that memdep gets invalidated when the analyses it depends on are
4 ; Check AA. AA is stateless, there's nothing to invalidate.
5 ; RUN: opt -disable-output -debug-pass-manager -aa-pipeline='basic-aa' %s 2>&1 \
6 ; RUN: -passes='require<memdep>,invalidate<aa>,gvn' \
7 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-INVALIDATE
8 ; CHECK-AA-INVALIDATE: Running pass: RequireAnalysisPass
9 ; CHECK-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis
10 ; CHECK-AA-INVALIDATE: Running pass: InvalidateAnalysisPass
11 ; CHECK-NOT-AA-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis
12 ; CHECK-AA-INVALIDATE: Running pass: GVN
13 ; CHECK-NOT-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis
15 ; Check domtree specifically.
16 ; RUN: opt -disable-output -debug-pass-manager %s 2>&1 \
17 ; RUN: -passes='require<memdep>,invalidate<domtree>,gvn' \
18 ; RUN: | FileCheck %s --check-prefix=CHECK-DT-INVALIDATE
19 ; CHECK-DT-INVALIDATE: Running pass: RequireAnalysisPass
20 ; CHECK-DT-INVALIDATE: Running analysis: MemoryDependenceAnalysis
21 ; CHECK-DT-INVALIDATE: Running pass: InvalidateAnalysisPass
22 ; CHECK-DT-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
23 ; CHECK-DT-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis
24 ; CHECK-DT-INVALIDATE: Running pass: GVN
25 ; CHECK-DT-INVALIDATE: Running analysis: MemoryDependenceAnalysis
28 define void @test_use_domtree(i32* nocapture %bufUInt, i32* nocapture %pattern) nounwind {
32 for.exit: ; preds = %for.body
35 for.body: ; preds = %for.body, %entry
36 %i.01 = phi i32 [ 0, %entry ], [ %tmp8.7, %for.body ]
37 %arrayidx = getelementptr i32, i32* %bufUInt, i32 %i.01
38 %arrayidx5 = getelementptr i32, i32* %pattern, i32 %i.01
39 %tmp6 = load i32, i32* %arrayidx5, align 4
40 store i32 %tmp6, i32* %arrayidx, align 4
41 %tmp8.7 = add i32 %i.01, 8
42 %cmp.7 = icmp ult i32 %tmp8.7, 1024
43 br i1 %cmp.7, label %for.body, label %for.exit
47 declare void @foo(i8*)
49 define void @test_use_aa(%t* noalias %stuff ) {
51 %p = getelementptr inbounds %t, %t* %stuff, i32 0, i32 0
52 %before = load i32, i32* %p
54 call void @foo(i8* null)
56 %after = load i32, i32* %p
57 %sum = add i32 %before, %after
59 store i32 %sum, i32* %p