Skip to content

Commit 3136218

Browse files
committed
PerformanceInliner: allow inlining of small functions even if the caller block limit is exceeded
This can fix performance problems in large functions. rdar://141320229
1 parent da02cd0 commit 3136218

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SILOptimizer/Transforms/PerformanceInliner.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,11 @@ void SILPerformanceInliner::collectAppliesToInline(
11511151
// caller block limit at this point. In such a case, we continue. This
11521152
// will ensure that any further non inline always functions are skipped,
11531153
// but we /do/ inline any inline_always functions remaining.
1154-
if (NumCallerBlocks > OverallCallerBlockLimit)
1154+
if (NumCallerBlocks > OverallCallerBlockLimit &&
1155+
// Still allow inlining of small functions.
1156+
!hasMaxNumberOfBasicBlocks(Callee, 8)) {
11551157
continue;
1158+
}
11561159

11571160
// Otherwise, calculate our block weights and determine if we want to
11581161
// inline this.

0 commit comments

Comments
 (0)