skia2/tests/sksl/inliner/golden
John Stiles 108bbe2522 Optimize away swizzles on single-argument constructors.
The optimizer can now turn the expression `half4(1).xyz` into
`half3(1)`, or `half4(1).w` into `1`. This is actually a somewhat common
case when inlining chains of fragment processors, as inputs are often
overridden to `half4(1)` or `half4(0)`. This optimization also applies
to more complex cases, e.g.:

     `half2(anyFunc(sqrt(2))).yxyx` --> `half4(anyFunc(sqrt(2)))`

Since the interior of the constructor is always evaluated once in either
case, it does not actually matter what the constructor contains.

Change-Id: I8d5f358502eaa8e35d4968e74fbd6b0ce2ab6365
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335818
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-18 17:02:45 +00:00
..
DoWhileBodyMustBeInlinedIntoAScope.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
DoWhileTestCannotBeInlined.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00
ExponentialGrowth.glsl Stop the inliner after it has inlined 2500 statements in a program. 2020-11-13 23:02:11 +00:00
ExponentialGrowthStandaloneSettings.glsl Stop the inliner after it has inlined 2500 statements in a program. 2020-11-13 23:02:11 +00:00
ForBodyMustBeInlinedIntoAScope.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
ForInitializerExpressionsCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
ForWithoutReturnInsideCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
ForWithReturnInsideCannotBeInlined.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00
IfBodyMustBeInlinedIntoAScope.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
IfElseBodyMustBeInlinedIntoAScope.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
IfElseChainWithReturnsCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
IfTestCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
IfWithReturnsCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlineKeywordOverridesThreshold.glsl Factor out Inliner candidate list assembly into its own function. 2020-10-02 20:39:24 +00:00
InlinerAvoidsVariableNameOverlap.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlinerCanBeDisabled.glsl Add test for disabling the inliner. 2020-10-12 17:14:07 +00:00
InlinerCanBeDisabledStandaloneSettings.glsl Directly compute call counts, rather than mutating state 2020-10-19 16:08:39 +00:00
InlinerManglesNames.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlinerWrapsEarlyReturnsWithDoWhileBlock.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlinerWrapsEarlyReturnsWithDoWhileBlockStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
InlineThreshold.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00
InlineWithInoutArgument.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlineWithModifiedArgument.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlineWithNestedBigCalls.glsl Factor out Inliner candidate list assembly into its own function. 2020-10-02 20:39:24 +00:00
InlineWithNestedCalls.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
InlineWithUnmodifiedArgument.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00
InlineWithUnnecessaryBlocks.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
ShortCircuitEvaluationsCannotInlineRightHandSide.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
SwitchWithCastCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
SwitchWithoutReturnInsideCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
SwitchWithReturnInsideCannotBeInlined.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00
SwizzleCanBeInlinedDirectly.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
TernaryResultsCannotBeInlined.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00
TernaryTestCanBeInlined.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
TrivialArgumentsInlineDirectly.glsl Optimize away swizzles on single-argument constructors. 2020-11-18 17:02:45 +00:00
WhileBodyMustBeInlinedIntoAScope.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
WhileTestCannotBeInlined.glsl Align default values of GrShaderCaps with StandaloneShaderCaps. 2020-09-16 15:16:37 +00:00