llvm-project
34 строки · 1.2 Кб
1; Test that the BasicAA analysis gets invalidated when its dependencies go
2; away.
3;
4; Check DomTree specifically.
5; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
6; RUN: -passes='require<aa>,invalidate<domtree>,aa-eval' -aa-pipeline='basic-aa' \
7; RUN: | FileCheck %s --check-prefix=CHECK-DT-INVALIDATE
8; CHECK-DT-INVALIDATE: Running pass: RequireAnalysisPass
9; CHECK-DT-INVALIDATE: Running analysis: BasicAA
10; CHECK-DT-INVALIDATE: Running pass: InvalidateAnalysisPass
11; CHECK-DT-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
12; CHECK-DT-INVALIDATE: Invalidating analysis: BasicAA
13; CHECK-DT-INVALIDATE: Running pass: AAEvaluator
14; CHECK-DT-INVALIDATE: Running analysis: BasicAA
15;
16; Some code that will result in actual AA queries, including inside of a loop.
17; FIXME: Sadly, none of these queries managed to use either the domtree or
18; loopinfo that basic-aa cache. But nor does any other test in LLVM. It would
19; be good to enhance this to actually use these other analyses to make this
20; a more thorough test.
21define void @foo(i1 %x, ptr %p1, ptr %p2) {
22entry:
23%p3 = alloca i8
24store i8 42, ptr %p1
25br i1 %x, label %loop, label %exit
26
27loop:
28store i8 13, ptr %p3
29%tmp1 = load i8, ptr %p2
30br label %loop
31
32exit:
33ret void
34}
35