aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/Inline/inline-call-penalty-option.ll
blob: ec8464fd354be1b5044b96be1f11f43149ace819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; Check that calls are not inlined if the call penalty is low. The value of the
; call penalty is provided with the '--inline-call-penalty' option.
;
; RUN: opt < %s -passes=inline --inline-call-penalty=0 --inline-threshold=5 -S | FileCheck %s
; RUN: opt < %s -passes=inline --inline-threshold=5 -S | FileCheck %s -check-prefix=DEFAULT_CALL_PENALTY

declare void @extern()

define void @X9() nounwind {
  call void @extern() "call-inline-cost"="30"
  ret void
}

define void @f1() nounwind {
  call void @X9()
  ret void
; CHECK-LABEL: @f1(
; CHECK: call void @X9

; DEFAULT_CALL_PENALTY-LABEL: @f1(
; DEFAULT_CALL_PENALTY: call void @extern
; DEFAULT_CALL_PENALTY-NOT: call void @X9
}