brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · c8b5198 Raw
43 lines · plain
1; Test that we can produce a log if we have or do not have a model, in development mode.2; REQUIRES: have_tflite3; Generate mock model4; RUN: rm -rf %t_savedmodel %t5; RUN: %python %S/../../../../lib/Analysis/models/gen-inline-oz-test-model.py %t_savedmodel6; RUN: %python %S/../../../../lib/Analysis/models/saved-model-to-tflite.py %t_savedmodel %t7;8; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=%t4 -ml-inliner-model-under-training=%t -S < %s9; RUN: %python %S/../../../../lib/Analysis/models/log_reader.py %t4 | FileCheck %s --check-prefix=NOREWARD10; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner -training-log=%t5 -S < %s11; RUN: %python %S/../../../../lib/Analysis/models/log_reader.py %t5| FileCheck %s --check-prefix=NOREWARD12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"13target triple = "x86_64-pc-linux-gnu"14declare i32 @f1(i32)15declare i32 @f2(i32)16define dso_local i32 @branches(i32) {17  %cond = icmp slt i32 %0, 318  br i1 %cond, label %then, label %else19then:20  %ret.1 = call i32 @f1(i32 %0)21  br label %last.block22else:23  %ret.2 = call i32 @f2(i32 %0)24  br label %last.block25last.block:26  %ret = phi i32 [%ret.1, %then], [%ret.2, %else]27  ret i32 %ret28}29define dso_local i32 @top() {30  %1 = call i32 @branches(i32 2)31  ret i32 %132}33!llvm.module.flags = !{!0}34!llvm.ident = !{!1}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 log that has inlining decisions and rewards.38; CHECK-NOT:        fake_extra_output:39; EXTRA-OUTPUTS:    fake_extra_output: {{[0-9]+}}40; CHECK:            inlining_decision: 141; CHECK:            delta_size: 042; NOREWARD-NOT:     delta_size:43