42 lines · plain
1; Test behavior when inlining policy grows size out of control.2; In all cases, the end result is the same: mandatory inlinings must happen.3; However, when we discover we 'trip' over the artificially-low size increase4; factor, we don't inline anymore.5; REQUIRES: llvm_inliner_model_autogenerated6; RUN: opt -passes=scc-oz-module-inliner -enable-ml-inliner=release -ml-advisor-size-increase-threshold=10.0 -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=NOBOUNDS7; RUN: opt -passes=scc-oz-module-inliner -enable-ml-inliner=release -ml-advisor-size-increase-threshold=1.0 -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=BOUNDS8 9target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"10target triple = "x86_64-grtev4-linux-gnu"11 12declare i64 @f1()13 14define i64 @f2() #0 {15 %r = call i64 @f1()16 %r2 = add i64 13, %r17 ret i64 %r218}19 20define i64 @some_function() {21 %r = call i64 @f1()22 %r2 = add i64 13, %r23 ret i64 %r224}25 26define i64 @top() {27 %r = call i64 @f2()28 %r2 = call i64 @some_function()29 %r3 = add i64 %r, %r230 ret i64 %r331}32 33attributes #0 = { alwaysinline }34 35; CHECK-LABEL: @top36; f2 must always be inlined, so we won't find a call to it in @top()37; CHECK-NOT: call i64 @f238; @some-function isn't mandatory, and when we set the increase threshold too low,39; it won't be inlined.40; NOBOUNDS-NOT: @some_function41; BOUNDS: call i64 @some_function42