skia2/tests/sksl/workarounds/golden
John Stiles 77702f1704 Eliminate inliner temporary variables for top-level-exit functions.
When we determine that a function only contains a single return
statement and it is at the top level (i.e. not inside any scopes),
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.

Unlike my previous solution, this does not require variable
declarations to be rewritten. The no-scopes limitation makes it
slightly less effective in theory, but in practice we still get
almost all of the benefit. The no-scope limitation bites us on
structures like

@if (true) {
    return x;
} else {
    return y;
}

Which will optimize away the if, but leave the scope:

{
    return x;
}

However, this is not a big deal; the biggest wins are single-line
helper functions like `guarded_divide` and `unpremul` which retain
the full benefit.

Change-Id: I7fbb725e65db021b9795c04c816819669815578f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345167
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-12-17 20:37:21 +00:00
..
AbsInt.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
AbsIntStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
BlendGuardedDivide.glsl Eliminate inliner temporary variables for top-level-exit functions. 2020-12-17 20:37:21 +00:00
BlendGuardedDivideStandaloneSettings.glsl Eliminate inliner temporary variables for top-level-exit functions. 2020-12-17 20:37:21 +00:00
BlendModesAllZeroVec.glsl Eliminate inliner temporary variables for top-level-exit functions. 2020-12-17 20:37:21 +00:00
BlendModesAllZeroVecStandaloneSettings.glsl Eliminate inliner temporary variables for top-level-exit functions. 2020-12-17 20:37:21 +00:00
FractNegative.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
FractNegativeStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
FragCoords.glsl Migrate remaining SkSL GLSL tests to golden outputs. 2020-09-18 19:22:19 +00:00
FragCoordsStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
LoopCondition.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
LoopConditionStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
MinAndAbsTogether.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
MinAndAbsTogetherStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
NegatedAtan.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
NegatedAtanStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
PowWithConstantExponent.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
PowWithConstantExponentStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
RewriteDoWhileLoops.glsl Migrate remaining SkSL GLSL tests to golden outputs. 2020-09-18 19:22:19 +00:00
RewriteDoWhileLoopsStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00
TernaryShortCircuit.glsl Migrate several GLSL workaround unit tests to golden files. 2020-09-17 16:41:18 +00:00
TernaryShortCircuitStandaloneSettings.glsl Rename 'DefaultSettings' golden outputs to 'StandaloneSettings'. 2020-09-21 22:15:51 +00:00