skia2/tests/sksl/workarounds
John Stiles ffc9dec755 Eliminate redundant loads following stores.
We now have two functions `writeOpLoad` and `writeOpStore` which are
in charge of writing SpvOpLoad and SpvOpStore instructions.
`writeOpStore` also keeps track of pointer stores in a "store cache."
Subsequent loads from that same pointer will be found in the cache and
will return the value stored in that pointer instead.

Such a cache definitely cannot work in the face of control flow, so we
make the following concessions:
- `pruneReachableOps` is now `pruneConditionalOps`. Any pointers that
  are altered inside a potentially-unreachable block are cleared from
  the cache entirely.
- The entire store cache is cleared at all OpLabels within a loop.

The cache also cannot work in the presence of swizzled stores, so we
make another significant concession:
- The entire store cache is cleared whenever we store into a non-memory
  pointer (e.g., assigning into a swizzled LValue, such as `foo.xz`).

Despite these significant limitations, this manages to dramatically
shrink many real-world examples.

Change-Id: I0981a0cf7b45b064e153e9ada271494c8e00cad5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530054
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-04-18 14:57:48 +00:00
..
AbsInt.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
AbsIntStandaloneSettings.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
BlendGuardedDivide.glsl Use $ prefix on built-in private functions. 2022-01-25 15:21:42 +00:00
BlendGuardedDivideStandaloneSettings.glsl Use $ prefix on built-in private functions. 2022-01-25 15:21:42 +00:00
FractNegative.glsl Performance experiment: disable control-flow analysis. 2021-03-08 19:41:19 +00:00
FractNegativeStandaloneSettings.glsl Performance experiment: disable control-flow analysis. 2021-03-08 19:41:19 +00:00
FragCoords.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
FragCoordsStandaloneSettings.glsl Reland "Don't key progams/pipelines on origin."" 2021-07-07 14:50:10 +00:00
LoopCondition.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
LoopConditionStandaloneSettings.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
MinAndAbsTogether.glsl Performance experiment: disable control-flow analysis. 2021-03-08 19:41:19 +00:00
MinAndAbsTogetherStandaloneSettings.glsl Performance experiment: disable control-flow analysis. 2021-03-08 19:41:19 +00:00
NegatedAtan.glsl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
NegatedAtanStandaloneSettings.glsl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
NegatedLdexp.glsl Add a workaround for "ldexp(..., -x)" on Mac/Radeon/GLSL 2021-06-08 01:39:38 +00:00
NegatedLdexpStandaloneSettings.glsl Add a workaround for "ldexp(..., -x)" on Mac/Radeon/GLSL 2021-06-08 01:39:38 +00:00
PowWithConstantExponent.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
PowWithConstantExponentStandaloneSettings.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RewriteDoWhileLoops.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RewriteDoWhileLoopsStandaloneSettings.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
RewriteMatrixComparisons.glsl Rewrite matrix comparisons to work around Adreno bug. 2021-05-24 13:42:19 +00:00
RewriteMatrixComparisonsStandaloneSettings.glsl Rename caps bit for matrix comparison rewrites. 2021-05-21 22:31:53 +00:00
RewriteMatrixVectorMultiply.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
RewriteMatrixVectorMultiply.glsl Rewrite matrix * vector multiplication on ARM GPUs. 2021-03-24 19:21:44 +00:00
RewriteMatrixVectorMultiplyStandaloneSettings.glsl Add caps bit for RewriteMatrixVectorMultiply. 2021-03-23 22:40:02 +00:00
TernaryShortCircuit.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
TernaryShortCircuitStandaloneSettings.glsl Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00