brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 71264ab Raw
58 lines · plain
1; REQUIRES: asserts2; RUN: opt -inline-cost-full -passes='cgscc(inline)' -debug-only=inline -disable-output %s 2>&1 | FileCheck --check-prefix=INLINER %s3; RUN: opt -inline-cost-full -passes='print<inline-cost>' -disable-output %s 2>&1 | FileCheck --check-prefix=COST %s4 5declare void @extern() "call-threshold-bonus"="31"6 7define void @fn1() "function-inline-cost"="321" "function-inline-threshold"="123" "call-inline-cost"="271" {8entry:9  ret void10}11 12define void @fn2() "function-inline-threshold"="41" {13; INLINER-LABEL: Inlining calls in: fn214; INLINER-NEXT: Function size: 715; INLINER-NEXT: NOT Inlining (cost=321, threshold=123), Call:   call void @fn1()16; INLINER-NEXT: NOT Inlining (cost=963, threshold=123), Call:   call void @fn1()17; INLINER-NEXT: NOT Inlining (cost=321, threshold=321), Call:   call void @fn1()18; INLINER-NEXT: NOT Inlining (cost=197, threshold=123), Call:   call void @fn1()19; INLINER-NEXT: Inlining (cost=197, threshold=321), Call:   call void @fn1()20 21; COST-LABEL: define void @fn2()22; COST-NEXT: entry:23; COST-NEXT: threshold delta = 3124; COST-NEXT: call void @extern()25; COST-NEXT: cost delta = 132, threshold delta = 19326; COST-NEXT: call void @fn1()27; COST-NEXT: cost delta = 132, threshold delta = 19328; COST-NEXT: call void @fn1()29; COST-NEXT: cost delta = 030; COST-NEXT: call void @fn1()31; COST-NEXT: cost delta = 271, threshold delta = 1732; COST-NEXT: call void @fn1()33; COST-NEXT: cost delta = 47334; COST-NEXT: call void @fn1()35 36entry:37  call void @extern()38  call void @fn1() "call-inline-cost"="132" "call-threshold-bonus"="193"39  call void @fn1() "call-inline-cost"="132" "call-threshold-bonus"="193" "function-inline-cost-multiplier"="3"40  call void @fn1() "call-inline-cost"="0" "function-inline-threshold"="321"41  call void @fn1() "call-threshold-bonus"="17" "function-inline-cost"="197"42  call void @fn1() "call-inline-cost"="473" "function-inline-cost"="197" "function-inline-threshold"="321"43  ret void44}45 46define void @fn3() {47; INLINER-LABEL: Inlining calls in: fn348; INLINER-NEXT: Function size: 349; INLINER-NEXT: Inlining (cost=386, threshold=849), Call:   call void @fn1()50; INLINER-NEXT: Size after inlining: 251; INLINER-NEXT: NOT Inlining (cost=535, threshold=41), Call:   call void @fn2()52 53entry:54  call void @fn1() "function-inline-cost"="386" "function-inline-threshold"="849"55  call void @fn2()56  ret void57}58