skia2/resources/sksl/folding
John Stiles 8397365524 Optimize away same-value ternaries.
A ternary of the form `anything ? value : value` can be reduced to a
comma-expression of the form `anything, value`. This seems like a rare
case in real code, but it's easy enough to detect with our existing
toolbox.

The `anything` test-expression will be eliminated from the expression
if it has no side effects, using our existing constant-folding rules
for the comma expression.

Change-Id: I1285b04cd6a08f1bed614aa1aa6f37ea2447de91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528439
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-04-07 19:37:00 +00:00
..
ArrayFolding.sksl Improve index-folding of arrays and matrices. 2021-11-11 18:59:04 +00:00
ArraySizeFolding.sksl Add test for vector constant folding. 2022-01-12 17:23:20 +00:00
AssignmentOps.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
BoolFolding.sksl Add new folding tests involving prefix expressions. 2022-04-05 19:52:07 +00:00
CastFolding.sksl Add test demonstrating missed opportunities with casts. 2021-05-07 22:04:16 +00:00
FloatFolding.sksl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00
IntFoldingES2.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
IntFoldingES3.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
MatrixFoldingES2.sksl Implement constant-folding for vector/matrix multiplication. 2022-03-25 21:42:47 +00:00
MatrixFoldingES3.sksl Implement constant-folding for vector/matrix multiplication. 2022-03-25 21:42:47 +00:00
Negation.sksl Add new folding tests involving prefix expressions. 2022-04-05 19:52:07 +00:00
PreserveSideEffects.sksl [sksl][test] Add more folding tests for side-effecting expressions 2022-03-10 18:06:12 +00:00
SelfAssignment.sksl Enforce consistency in swizzle domains. 2021-07-09 20:30:22 +00:00
ShortCircuitBoolFolding.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
SwitchCaseFolding.sksl Simplify control flow in switch test to unbreak iOS. 2022-01-13 14:49:06 +00:00
SwizzleFolding.sksl Add test demonstrating swizzled constant folding. 2021-04-29 15:59:37 +00:00
TernaryFolding.sksl Optimize away same-value ternaries. 2022-04-07 19:37:00 +00:00
VectorScalarFolding.sksl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00
VectorVectorFolding.sksl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00