xref: /llvm-project/llvm/test/Transforms/Inline/ML/interactive-mode.ll (revision ab2e7666c20d00a43b958e91c24991c973c81393)
1; REQUIRES: x86_64-linux
2; RUN: rm -rf %t.rundir
3; RUN: rm -rf %t.channel-basename.*
4; RUN: mkdir %t.rundir
5; RUN: cp %S/../../../../lib/Analysis/models/log_reader.py %t.rundir
6; RUN: cp %S/../../../../lib/Analysis/models/interactive_host.py %t.rundir
7; RUN: cp %S/Inputs/interactive_main.py %t.rundir
8; RUN: %python %t.rundir/interactive_main.py %t.channel-basename \
9; RUN:    opt -passes=scc-oz-module-inliner -interactive-model-runner-echo-reply \
10; RUN:    -enable-ml-inliner=release -inliner-interactive-channel-base=%t.channel-basename %S/Inputs/test-module.ll -S -o /dev/null | FileCheck %s
11; RUN: %python %t.rundir/interactive_main.py %t.channel-basename \
12; RUN:    opt -passes=scc-oz-module-inliner -interactive-model-runner-echo-reply \
13; RUN:    -inliner-interactive-include-default -enable-ml-inliner=release \
14; RUN:    -inliner-interactive-channel-base=%t.channel-basename %S/Inputs/test-module.ll -S -o /dev/null | FileCheck %s -check-prefixes=CHECK,CHECK-DEFAULT
15
16
17;; It'd be nice if we had stdout and stderr interleaved, but we don't, so
18;; let's just check the features have non-zero values, and that we see as many
19;; advices as observations, and that the advices flip-flop as intended.
20; CHECK: context:
21; CHECK-NEXT: observation: 0
22; CHECK-NEXT: sroa_savings: 0
23; CHECK:      unsimplified_common_instructions: 5
24; CHECK:      callee_users: 3
25; CHECK-DEFAULT: inlining_default: 0
26; CHECK:      observation: 5
27; CHECK-NOT:  observation: 6
28
29; CHECK:      inlining_decision: 1
30; CHECK-NEXT: inlining_decision: 0
31; CHECK-NEXT: inlining_decision: 1
32; CHECK-NEXT: inlining_decision: 0
33; CHECK-NEXT: inlining_decision: 1
34; CHECK-NEXT: inlining_decision: 0
35