llvm.org GIT mirror llvm / 0f9492a
[PM] Add more dedicated testing to cover the invalidation logic added to BasicAA in r290603. I've kept the basic testing in the new PM test file as that also covers the AAManager invalidation logic. If/when there is a good place for broader AA testing it could move there. This test is somewhat unsatisfying as I can't get it to fail even with ASan outside of explicit checks of the invalidation. Apparently we don't yet have any test coverage of the BasicAA code paths using either the domtree or loopinfo -- I made both of them always be null and check-llvm passed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290612 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 3 years ago
1 changed file(s) with 47 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; Test that the BasicAA analysis gets invalidated when its dependencies go
1 ; away.
2 ;
3 ; Check DomTree specifically.
4 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
5 ; RUN: -passes='require,invalidate,aa-eval' -aa-pipeline='basic-aa' \
6 ; RUN: | FileCheck %s --check-prefix=CHECK-DT-INVALIDATE
7 ; CHECK-DT-INVALIDATE: Running pass: RequireAnalysisPass
8 ; CHECK-DT-INVALIDATE: Running analysis: BasicAA
9 ; CHECK-DT-INVALIDATE: Running pass: InvalidateAnalysisPass
10 ; CHECK-DT-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
11 ; CHECK-DT-INVALIDATE: Invalidating analysis: BasicAA
12 ; CHECK-DT-INVALIDATE: Running pass: AAEvaluator
13 ; CHECK-DT-INVALIDATE: Running analysis: BasicAA
14 ;
15 ; Check LoopInfo specifically.
16 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
17 ; RUN: -passes='require,require,invalidate,aa-eval' -aa-pipeline='basic-aa' \
18 ; RUN: | FileCheck %s --check-prefix=CHECK-LI-INVALIDATE
19 ; CHECK-LI-INVALIDATE: Running pass: RequireAnalysisPass
20 ; CHECK-LI-INVALIDATE: Running analysis: BasicAA
21 ; CHECK-LI-INVALIDATE: Running pass: InvalidateAnalysisPass
22 ; CHECK-LI-INVALIDATE: Invalidating analysis: LoopAnalysis
23 ; CHECK-LI-INVALIDATE: Invalidating analysis: BasicAA
24 ; CHECK-LI-INVALIDATE: Running pass: AAEvaluator
25 ; CHECK-LI-INVALIDATE: Running analysis: BasicAA
26
27 ; Some code that will result in actual AA queries, including inside of a loop.
28 ; FIXME: Sadly, none of these queries managed to use either the domtree or
29 ; loopinfo that basic-aa cache. But nor does any other test in LLVM. It would
30 ; be good to enhance this to actually use these other analyses to make this
31 ; a more thorough test.
32 define void @foo(i1 %x, i8* %p1, i8* %p2) {
33 entry:
34 %p3 = alloca i8
35 store i8 42, i8* %p1
36 %gep2 = getelementptr i8, i8* %p2, i32 0
37 br i1 %x, label %loop, label %exit
38
39 loop:
40 store i8 13, i8* %p3
41 %tmp1 = load i8, i8* %gep2
42 br label %loop
43
44 exit:
45 ret void
46 }