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
AbsIntStandaloneSettings.glsl
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
FractNegativeStandaloneSettings.glsl
FragCoords.glsl
FragCoordsStandaloneSettings.glsl Reland "Don't key progams/pipelines on origin."" 2021-07-07 14:50:10 +00:00
LoopCondition.glsl
LoopConditionStandaloneSettings.glsl
MinAndAbsTogether.glsl
MinAndAbsTogetherStandaloneSettings.glsl
NegatedAtan.glsl
NegatedAtanStandaloneSettings.glsl
NegatedLdexp.glsl
NegatedLdexpStandaloneSettings.glsl
PowWithConstantExponent.glsl
PowWithConstantExponentStandaloneSettings.glsl
RewriteDoWhileLoops.glsl
RewriteDoWhileLoopsStandaloneSettings.glsl
RewriteMatrixComparisons.glsl
RewriteMatrixComparisonsStandaloneSettings.glsl
RewriteMatrixVectorMultiply.asm.frag Eliminate redundant loads following stores. 2022-04-18 14:57:48 +00:00
RewriteMatrixVectorMultiply.glsl
RewriteMatrixVectorMultiplyStandaloneSettings.glsl
TernaryShortCircuit.glsl
TernaryShortCircuitStandaloneSettings.glsl