xref: /llvm-project/llvm/test/Transforms/Inline/clear-analyses.ll (revision 34a8a437bf20e0a340c19ed1fdb9cca584d43da1)
1; Test that when a pass like correlated-propagation populates an analysis such
2; as LVI with references back into the IR of a function that the inliner will
3; delete, this doesn't crash or go awry despite the inliner clearing the analyses
4; separately from when it deletes the function.
5;
6; RUN: opt -debug-pass-manager -S < %s 2>&1 \
7; RUN:     -passes='cgscc(inline,function(correlated-propagation))' \
8; RUN:     | FileCheck %s
9;
10; CHECK: Running pass: InlinerPass on (callee)
11; CHECK: Running pass: CorrelatedValuePropagationPass on callee
12; CHECK: Running analysis: LazyValueAnalysis
13; CHECK: Running pass: InlinerPass on (caller)
14; CHECK: Clearing all analysis results for: callee
15; CHECK: Running pass: CorrelatedValuePropagationPass on caller
16; CHECK: Running analysis: LazyValueAnalysis
17
18define internal i32 @callee(i32 %x) {
19; CHECK-NOT: @callee
20entry:
21  ret i32 %x
22}
23
24define i32 @caller(i32 %x) {
25; CHECK-LABEL: define i32 @caller
26entry:
27  %call = call i32 @callee(i32 %x)
28; CHECK-NOT: call
29  ret i32 %call
30; CHECK: ret i32 %x
31}
32