development-training-log.ll
2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
; Test that we can produce a log if we have or do not have a model, in development mode.
; REQUIRES: have_tf_api
; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -ml-inliner-model-under-training=%S/../../../../lib/Analysis/models/inliner -ml-inliner-ir2native-model=%S/../../../../unittests/Analysis/Inputs/ir2native_x86_64_model -S < %s | FileCheck %s
; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -ml-inliner-model-under-training=%S/../../../../lib/Analysis/models/inliner -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
; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -ml-inliner-ir2native-model=%S/../../../../unittests/Analysis/Inputs/ir2native_x86_64_model -S < %s | FileCheck %s
; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -ml-inliner-model-under-training=%S/../../../../lib/Analysis/models/inliner -S < %s | FileCheck %s --check-prefix=NOREWARD
; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=- -S < %s | FileCheck %s --check-prefix=NOREWARD
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
declare i32 @f1(i32)
declare i32 @f2(i32)
define dso_local i32 @branches(i32) {
%cond = icmp slt i32 %0, 3
br i1 %cond, label %then, label %else
then:
%ret.1 = call i32 @f1(i32 %0)
br label %last.block
else:
%ret.2 = call i32 @f2(i32 %0)
br label %last.block
last.block:
%ret = phi i32 [%ret.1, %then], [%ret.2, %else]
ret i32 %ret
}
define dso_local i32 @top() {
%1 = call i32 @branches(i32 2)
ret i32 %1
}
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 7.0.0-6 (tags/RELEASE_700/final)"}
; Check we produce a protobuf that has inlining decisions and rewards.
; CHECK: feature_lists: {
; CHECK: key: "inlining_decision" value: {
; CHECK-NEXT: feature: { int64_list: { value: [1] } }
; CHECK-NEXT: }
; CHECK-NEXT: }
; CHECK-NEXT: feature_list: {
; CHECK-NEXT: key: "delta_size" value: {
; CHECK-NEXT: feature: { int64_list: { value: [0] } }
; CHECK-NEXT: }
; CHECK-NEXT: }
; NOREWARD-NOT: key: "delta_size" value: {
; CHECK-NOT: fake_extra_output
; EXTRA-OUTPUTS: key: "fake_extra_output" value: {
; EXTRA-OUTPUTS-NEXT: feature: { int64_list: { value: [1] } }
; EXTRA-OUTPUTS-NEXT: }
; EXTRA-OUTPUTS-NEXT: }