xref: /llvm-project/llvm/test/Transforms/MemProfContextDisambiguation/pass-pipeline.ll (revision 700cd99061edeeba7b657e32acca940225fa25ae)
1;; Test that MemProfContextDisambiguation is enabled under the expected conditions
2;; and in the expected position.
3
4;; Pass is not currently enabled by default at any opt level.
5; RUN: opt -debug-pass-manager -passes='lto<O0>' -S %s \
6; RUN:     2>&1 | FileCheck %s --implicit-check-not="Running pass: MemProfContextDisambiguation"
7; RUN: opt -debug-pass-manager -passes='lto<O1>' -S %s \
8; RUN:     2>&1 | FileCheck %s --implicit-check-not="Running pass: MemProfContextDisambiguation"
9; RUN: opt -debug-pass-manager -passes='lto<O2>' -S %s \
10; RUN:     2>&1 | FileCheck %s --implicit-check-not="Running pass: MemProfContextDisambiguation"
11; RUN: opt -debug-pass-manager -passes='lto<O3>' -S %s \
12; RUN:     2>&1 | FileCheck %s --implicit-check-not="Running pass: MemProfContextDisambiguation"
13
14;; Pass should not run even under option at O0/O1.
15; RUN: opt -debug-pass-manager -passes='lto<O0>' -S %s \
16; RUN:     -enable-memprof-context-disambiguation \
17; RUN:     2>&1 | FileCheck %s --implicit-check-not="Running pass: MemProfContextDisambiguation"
18; RUN: opt -debug-pass-manager -passes='lto<O1>' -S %s \
19; RUN:     -enable-memprof-context-disambiguation \
20; RUN:     2>&1 | FileCheck %s --implicit-check-not="Running pass: MemProfContextDisambiguation"
21
22;; Pass should be enabled under option at O2/O3.
23; RUN: opt -debug-pass-manager -passes='lto<O2>' -S %s \
24; RUN:     -enable-memprof-context-disambiguation \
25; RUN:     2>&1 | FileCheck %s --check-prefix=ENABLED
26; RUN: opt -debug-pass-manager -passes='lto<O3>' -S %s \
27; RUN:     -enable-memprof-context-disambiguation \
28; RUN:     2>&1 | FileCheck %s --check-prefix=ENABLED
29
30;; When enabled, MemProfContextDisambiguation runs just after inlining.
31; ENABLED: Running pass: InlinerPass
32; ENABLED: Invalidating analysis: InlineAdvisorAnalysis
33; ENABLED: Running pass: MemProfContextDisambiguation
34
35define noundef ptr @_Z3barv() {
36entry:
37  %call = call noalias noundef nonnull ptr @_Znam(i64 noundef 10)
38  ret ptr %call
39}
40
41declare noundef nonnull ptr @_Znam(i64 noundef)
42