1 ; Test that we can produce a log if we have or do not have a model, in development mode.
2 ; REQUIRES: have_tf_api
5 ; RUN: %python %S/../../../../lib/Analysis/models/generate_mock_model.py %S/../../../../lib/Analysis/models/inlining/config.py %t
7 ; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -tfutils-text-log -ml-inliner-model-under-training=%t -ml-inliner-ir2native-model=%S/../../../../unittests/Analysis/Inputs/ir2native_x86_64_model -S < %s | FileCheck %s
8 ; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -tfutils-text-log -ml-inliner-model-under-training=%t -ml-inliner-ir2native-model=%S/../../../../unittests/Analysis/Inputs/ir2native_x86_64_model -ml-inliner-output-spec-override=%S/Inputs/test_output_spec.json -S < %s | FileCheck %s --check-prefixes=EXTRA-OUTPUTS,CHECK
9 ; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -tfutils-text-log -ml-inliner-ir2native-model=%S/../../../../unittests/Analysis/Inputs/ir2native_x86_64_model -S < %s | FileCheck %s
10 ; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -tfutils-text-log -ml-inliner-model-under-training=%t -S < %s | FileCheck %s --check-prefix=NOREWARD
11 ; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -tfutils-text-log -S < %s | FileCheck %s --check-prefix=NOREWARD
12 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13 target triple = "x86_64-pc-linux-gnu"
16 define dso_local i32 @branches(i32) {
17 %cond = icmp slt i32 %0, 3
18 br i1 %cond, label %then, label %else
20 %ret.1 = call i32 @f1(i32 %0)
23 %ret.2 = call i32 @f2(i32 %0)
26 %ret = phi i32 [%ret.1, %then], [%ret.2, %else]
29 define dso_local i32 @top() {
30 %1 = call i32 @branches(i32 2)
33 !llvm.module.flags = !{!0}
35 !0 = !{i32 1, !"wchar_size", i32 4}
36 !1 = !{!"clang version 7.0.0-6 (tags/RELEASE_700/final)"}
37 ; Check we produce a protobuf that has inlining decisions and rewards.
38 ; CHECK: key: "delta_size"
40 ; CHECK-NEXT: feature {
41 ; CHECK-NEXT: int64_list {
42 ; CHECK-NEXT: value: 0
45 ; CHECK-NOT: fake_extra_output
46 ; EXTRA-OUTPUTS: key: "fake_extra_output"
47 ; EXTRA-OUTPUTS-NEXT: value {
48 ; EXTRA-OUTPUTS-NEXT: feature {
49 ; EXTRA-OUTPUTS-NEXT: int64_list {
50 ; EXTRA-OUTPUTS-NEXT: value: {{[0-9]+}}
51 ; CHECK: key: "inlining_decision"
53 ; CHECK-NEXT: feature {
54 ; CHECK-NEXT: int64_list {
55 ; CHECK-NEXT: value: 1
56 ; NOREWARD-NOT: key: "delta_size"