skia2/tests/sksl/shared
John Stiles 345d72124d Eliminate inliner temporary variables for functions with a single exit.
When we determine that a function only contains a single return
statement, there is no need to create a temporary variable and store the
result expression into a variable. Instead, we can directly replace the
function-call expression with the return-statement's expression.

This dramatically simplifies the final optimized output from chains of
very simple inlined functions, which is a very common pattern for trees
of Skia fragment processors.

Change-Id: I6789064a321daf43db2e1cef4915f25ed74d6131
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344665
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-16 17:26:06 +00:00
..
golden Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00
ArrayConstructors.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ArrayIndexTypes.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ArrayTypes.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Assignment.sksl Add unit tests for assignment and invalid field access. 2020-09-25 21:42:22 +00:00
BoolFolding.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Caps.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
CastsRoundTowardZero.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Clockwise.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ComplexDelete.sksl Disallow identifier names that overlap existing types. 2020-12-04 16:52:01 +00:00
ConstantIf.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ConstArray.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ConstVariableComparison.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Control.sksl Fix codegen errors with Metal return statements. 2020-12-01 21:28:05 +00:00
DeadDoWhileLoop.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
DeadIfStatement.sksl Create test case for oss-fuzz:26942. 2020-11-03 17:19:22 +00:00
DeadLoopVariable.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
DeadStripFunctions.sksl Add unit test for function dead-stripping. 2020-11-30 15:16:44 +00:00
DependentInitializers.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Derivatives.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
DerivativesFlipY.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
DerivativesUnused.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Discard.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Enum.sksl Add support for enums in Metal code generator. 2020-11-30 15:14:34 +00:00
FloatFolding.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
FragCoordsFlipY.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
FragCoordsNew.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
FragCoordsOld.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
FrExp.sksl Add $genHType versions of frexp and ldexp. 2020-12-09 01:05:23 +00:00
FunctionArgumentMatch.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
FunctionPrototype.sksl Add test cases to function-prototype golden outputs. 2020-11-02 17:17:23 +00:00
Functions.sksl Disallow multi-dimensional arrays in SkSL. 2020-12-03 16:28:19 +00:00
GaussianBlur.sksl Add unit test demonstrating output from Gaussian blur. 2020-11-23 20:46:54 +00:00
GeometricIntrinsics.sksl SkSL: Add test for scalar versions of geometric intrinsics 2020-11-24 20:38:20 +00:00
Geometry.geom Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
GeometryExtension.geom Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
GeometryGSInvocations.geom Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
GeometryNoGSInvocations.geom Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
GeometryNoGSInvocationsReorder.geom Add geometry shader test demonstrating max_vertices/invocations bug 2020-10-12 21:19:33 +00:00
Height.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
HelloWorld.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Hex.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
InstanceID.vert Enforce layout(location=...) on Metal out variables. 2020-12-01 20:41:15 +00:00
InterfaceBlockAnonymous.sksl Enforce that layout(binding=...) is set on interface blocks in Metal. 2020-12-04 19:30:35 +00:00
InterfaceBlockArray.sksl Enforce that layout(binding=...) is set on interface blocks in Metal. 2020-12-04 19:30:35 +00:00
InterfaceBlockNamed.sksl Enforce that layout(binding=...) is set on interface blocks in Metal. 2020-12-04 19:30:35 +00:00
IntFolding.sksl Add unit test to demonstrate error with modulo in FP files. 2020-10-29 20:46:08 +00:00
Matrices.sksl Convert remaining Metal tests to golden outputs. 2020-11-16 16:32:56 +00:00
MatrixFolding.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
MixedTypeCommaOperator.sksl Replace SPIR-V assertion with mixed-types error message. 2020-11-25 15:13:27 +00:00
MultipleAssignments.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
NegatedVectorLiteral.sksl Allow constant propagation for negated constant-vectors and ints. 2020-11-05 17:39:48 +00:00
NoFragCoordsPos.vert Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
NoFragCoordsPosRT.vert Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NormalizationGeo.geom Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
NormalizationVert.vert Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NumberConversions.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Offset.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Operators.sksl Remove accidentally-commited conflict markers. 2020-11-25 19:36:21 +00:00
Ossfuzz26167.sksl Fix use-after-free discovered by fuzzer. 2020-10-23 16:10:15 +00:00
Ossfuzz27614.sksl Add fix for fuzzer-discovered crash at oss-fuzz:27614. 2020-11-18 21:01:15 +00:00
Ossfuzz28050.sksl Fix ASAN error when inlining array constructor expressions. 2020-11-30 18:37:05 +00:00
OutParams.sksl Detect cases in Metal where out params are swizzled. 2020-12-07 17:12:09 +00:00
OutParamsTricky.sksl Add 'tricky' OutParams golden output. 2020-09-28 18:52:13 +00:00
RectangleTexture.sksl Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ResizeMatrix.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
SampleMask.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ScopedSymbol.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
ShortCircuitBoolFolding.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StackingVectorCasts.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticIf.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitch.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithBreak.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithBreakInsideBlock.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithConditionalBreak.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithConditionalBreakInsideBlock.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithFallthroughA.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithFallthroughB.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithStaticConditionalBreak.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StaticSwitchWithStaticConditionalBreakInsideBlock.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
StructMaxDepth.sksl Disallow multi-dimensional arrays in SkSL. 2020-12-03 16:28:19 +00:00
Structs.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Switch.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
SwitchContainingDeadCode.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
SwitchWithFallthrough.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
SwizzleBoolConstants.sksl Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
SwizzleByIndex.sksl Replace array indexing on vector types with swizzles. 2020-12-07 21:16:40 +00:00
SwizzleConstants.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
SwizzleLTRB.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
SwizzleOpt.sksl Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleScalar.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
TernaryAsLValueEntirelyFoldable.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
TernaryAsLValueFoldableTest.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
Texture1D.sksl Split Texture test into separate 1D and 2D tests. 2020-11-02 14:39:31 +00:00
Texture2D.sksl Split Texture test into separate 1D and 2D tests. 2020-11-02 14:39:31 +00:00
TextureSharpen.sksl Detect non-2D textures in MetalCodeGenerator and fail cleanly 2020-10-02 20:36:04 +00:00
UnaryPositiveNegative.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
UniformArray.sksl Disallow multi-dimensional arrays in SkSL. 2020-12-03 16:28:19 +00:00
UnusedVariables.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
VectorConstructors.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00
VectorFolding.sksl Add fix for fuzzer-discovered crash with negated constructors. 2020-11-18 21:53:45 +00:00
VertexEarlyReturn.vert Fix codegen errors with Metal return statements. 2020-12-01 21:28:05 +00:00
VertexID.vert Enforce layout(location=...) on Metal out variables. 2020-12-01 20:41:15 +00:00
Width.sksl Migrate most SkSL tests currently in /glsl/ to /shared/. 2020-09-25 17:13:53 +00:00