• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that memdep gets invalidated when the analyses it depends on are
2; invalidated.
3;
4; Check AA specifically.
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-AA-INVALIDATE: Invalidating analysis: AAManager
12; CHECK-AA-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis
13; CHECK-AA-INVALIDATE: Running pass: GVN
14; CHECK-AA-INVALIDATE: Running analysis: MemoryDependenceAnalysis
15;
16; Check domtree specifically.
17; RUN: opt -disable-output -debug-pass-manager %s 2>&1 \
18; RUN:     -passes='require<memdep>,invalidate<domtree>,gvn' \
19; RUN:     | FileCheck %s --check-prefix=CHECK-DT-INVALIDATE
20; CHECK-DT-INVALIDATE: Running pass: RequireAnalysisPass
21; CHECK-DT-INVALIDATE: Running analysis: MemoryDependenceAnalysis
22; CHECK-DT-INVALIDATE: Running pass: InvalidateAnalysisPass
23; CHECK-DT-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
24; CHECK-DT-INVALIDATE: Invalidating analysis: MemoryDependenceAnalysis
25; CHECK-DT-INVALIDATE: Running pass: GVN
26; CHECK-DT-INVALIDATE: Running analysis: MemoryDependenceAnalysis
27;
28
29define void @test_use_domtree(i32* nocapture %bufUInt, i32* nocapture %pattern) nounwind {
30entry:
31  br label %for.body
32
33for.exit:                                         ; preds = %for.body
34  ret void
35
36for.body:                                         ; preds = %for.body, %entry
37  %i.01 = phi i32 [ 0, %entry ], [ %tmp8.7, %for.body ]
38  %arrayidx = getelementptr i32, i32* %bufUInt, i32 %i.01
39  %arrayidx5 = getelementptr i32, i32* %pattern, i32 %i.01
40  %tmp6 = load i32, i32* %arrayidx5, align 4
41  store i32 %tmp6, i32* %arrayidx, align 4
42  %tmp8.7 = add i32 %i.01, 8
43  %cmp.7 = icmp ult i32 %tmp8.7, 1024
44  br i1 %cmp.7, label %for.body, label %for.exit
45}
46
47%t = type { i32 }
48declare void @foo(i8*)
49
50define void @test_use_aa(%t* noalias %stuff ) {
51entry:
52  %p = getelementptr inbounds %t, %t* %stuff, i32 0, i32 0
53  %before = load i32, i32* %p
54
55  call void @foo(i8* null)
56
57  %after = load i32, i32* %p
58  %sum = add i32 %before, %after
59
60  store i32 %sum, i32* %p
61  ret void
62}
63