Skip to content

Commit 980a590

Browse files
committed
[sil-inliner] Transparent functions should be inlined by the performance inliner as if they are always inline functions
1 parent 341b5c5 commit 980a590

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/SILOptimizer/Transforms/PerformanceInliner.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,10 @@ decideInWarmBlock(FullApplySite AI,
413413

414414
SILFunction *Callee = AI.getReferencedFunction();
415415

416-
if (Callee->getInlineStrategy() == AlwaysInline) {
416+
if (Callee->getInlineStrategy() == AlwaysInline || Callee->isTransparent()) {
417417
DEBUG(
418418
dumpCaller(AI.getFunction());
419-
llvm::dbgs() << " always-inline decision " <<Callee->getName() << '\n';
419+
llvm::dbgs() << " always-inline decision " << Callee->getName() << '\n';
420420
);
421421
return true;
422422
}
@@ -436,8 +436,13 @@ bool SILPerformanceInliner::decideInColdBlock(FullApplySite AI,
436436
return false;
437437
}
438438

439-
if (Callee->getInlineStrategy() == AlwaysInline)
439+
if (Callee->getInlineStrategy() == AlwaysInline || Callee->isTransparent()) {
440+
DEBUG(
441+
dumpCaller(AI.getFunction());
442+
llvm::dbgs() << " always-inline decision " << Callee->getName() << '\n';
443+
);
440444
return true;
445+
}
441446

442447
int CalleeCost = 0;
443448

0 commit comments

Comments
 (0)