skia2/resources/sksl/inliner
John Stiles dc20847579 Disallow inlining functions containing early returns.
This allows us to remove 100 LOC from the inliner and is very unlikely
to affect any existing benchmark. We don't have any evidence to support
the idea that a one-iteration `for` loop with `continue`-based exits
will be any faster than a standard function call on any existing GPU.
Our fragment processors are generally written to avoid early returns,
in large part to avoid hitting this path.

This drastically impacts BlendEnum.sksl (which can no longer flatten out
a switch over every blend function in SkSL) but is otherwise a wash.

See: http://go/optimization-in-sksl-inliner suggestion 4(a)

Change-Id: I1f9c27bcd7a8de46cc4e8d0b9768d75957cf1c50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385377
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-17 16:29:00 +00:00
..
DoWhileBodyMustBeInlinedIntoAScope.sksl
DoWhileTestCannotBeInlined.sksl
EnumsCanBeInlinedSafely.sksl
ExponentialGrowth.sksl
ForBodyMustBeInlinedIntoAScope.sksl
ForInitializerExpressionsCanBeInlined.sksl
ForWithoutReturnInsideCanBeInlined.sksl
ForWithReturnInsideCannotBeInlined.sksl
IfBodyMustBeInlinedIntoAScope.sksl
IfElseBodyMustBeInlinedIntoAScope.sksl
IfElseChainWithReturnsCanBeInlined.sksl
IfTestCanBeInlined.sksl
IfWithReturnsCanBeInlined.sksl
InlineKeywordOverridesThreshold.sksl
InlinerAvoidsVariableNameOverlap.sksl
InlinerCanBeDisabled.sksl
InlinerElidesTempVarForReturnsInsideBlock.sksl
InlinerHonorsGLSLOutParamSemantics.sksl
InlinerManglesNames.sksl
InlinerUsesTempVarForMultipleReturns.sksl
InlinerUsesTempVarForReturnsInsideBlockWithVar.sksl
InlineThreshold.sksl
InlineWithInoutArgument.sksl
InlineWithModifiedArgument.sksl
InlineWithNestedBigCalls.sksl
InlineWithNestedCalls.sksl
InlineWithUnmodifiedArgument.sksl
InlineWithUnnecessaryBlocks.sksl
NoInline.sksl Add noinline keyword to SkSL. 2021-03-10 15:39:48 +00:00
ShortCircuitEvaluationsCannotInlineRightHandSide.sksl
StaticSwitch.sksl Eliminate control-flow analysis. 2021-03-11 13:24:54 +00:00
StructsCanBeInlinedSafely.sksl
SwitchWithCastCanBeInlined.sksl
SwitchWithoutReturnInsideCanBeInlined.sksl
SwizzleCanBeInlinedDirectly.sksl
TernaryResultsCannotBeInlined.sksl
TernaryTestCanBeInlined.sksl
TrivialArgumentsInlineDirectly.sksl
WhileBodyMustBeInlinedIntoAScope.sksl
WhileTestCannotBeInlined.sksl