24 lines · plain
1; Check that calls are not inlined if the call penalty is low. The value of the2; call penalty is provided with the '--inline-call-penalty' option.3;4; RUN: opt < %s -passes=inline --inline-call-penalty=0 --inline-threshold=5 -S | FileCheck %s5; RUN: opt < %s -passes=inline --inline-threshold=5 -S | FileCheck %s -check-prefix=DEFAULT_CALL_PENALTY6 7declare void @extern()8 9define void @X9() nounwind {10 call void @extern() "call-inline-cost"="30"11 ret void12}13 14define void @f1() nounwind {15 call void @X9()16 ret void17; CHECK-LABEL: @f1(18; CHECK: call void @X919 20; DEFAULT_CALL_PENALTY-LABEL: @f1(21; DEFAULT_CALL_PENALTY: call void @extern22; DEFAULT_CALL_PENALTY-NOT: call void @X923}24