mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
PerformanceInliner: add the @_semantics("optimize.sil.inline.aggressive") attribute to enable inlining into large functions.
This attribute overrides the limit of maximum number of basic blocks in the caller.
This commit is contained in:
@@ -412,6 +412,11 @@ optimize.sil.specialize.owned2guarantee.never
|
||||
Disable function signature optimization which converts an "owned" to a
|
||||
"guaranteed" function parameter.
|
||||
|
||||
optimize.sil.inline.aggressive
|
||||
|
||||
Inlines into this function more aggressively than it would be done without
|
||||
this attribute.
|
||||
|
||||
Availability checks
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -75,6 +75,8 @@ SEMANTICS_ATTR(OPTIMIZE_SIL_SPECIALIZE_GENERIC_SIZE_NEVER,
|
||||
"optimize.sil.specialize.generic.size.never")
|
||||
SEMANTICS_ATTR(OPTIMIZE_SIL_SPECIALIZE_OWNED2GUARANTEE_NEVER,
|
||||
"optimize.sil.specialize.owned2guarantee.never")
|
||||
SEMANTICS_ATTR(OPTIMIZE_SIL_INLINE_AGGRESSIVE,
|
||||
"optimize.sil.inline.aggressive")
|
||||
|
||||
// To be used on a nominal type declaration.
|
||||
// Assumes that a class (or class references inside a nominal type) are immortal.
|
||||
|
||||
@@ -1153,7 +1153,8 @@ void SILPerformanceInliner::collectAppliesToInline(
|
||||
// but we /do/ inline any inline_always functions remaining.
|
||||
if (NumCallerBlocks > OverallCallerBlockLimit &&
|
||||
// Still allow inlining of small functions.
|
||||
!hasMaxNumberOfBasicBlocks(Callee, 8)) {
|
||||
!hasMaxNumberOfBasicBlocks(Callee, 8) &&
|
||||
!Caller->hasSemanticsAttr(semantics::OPTIMIZE_SIL_INLINE_AGGRESSIVE)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user