skia2/tests/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.glsl Improve index-folding of arrays and matrices. 2021-11-11 18:59:04 +00:00
ArraySizeFolding.glsl Add test for vector constant folding. 2022-01-12 17:23:20 +00:00
AssignmentOps.glsl
BoolFolding.glsl Allow prefix-expressions in IsSameExpressionTree. 2022-04-05 20:16:35 +00:00
CastFolding.glsl
FloatFolding.glsl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00
IntFoldingES2.glsl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00
IntFoldingES3.glsl
MatrixFoldingES2.glsl Implement constant-folding for vector/matrix multiplication. 2022-03-25 21:42:47 +00:00
MatrixFoldingES3.glsl Implement constant-folding for vector/matrix multiplication. 2022-03-25 21:42:47 +00:00
Negation.glsl Simplify -1 * x into -x. 2022-04-05 20:27:15 +00:00
PreserveSideEffects.glsl [sksl][test] Add more folding tests for side-effecting expressions 2022-03-10 18:06:12 +00:00
SelfAssignment.glsl
ShortCircuitBoolFolding.glsl
SwitchCaseFolding.glsl Simplify control flow in switch test to unbreak iOS. 2022-01-13 14:49:06 +00:00
SwizzleFolding.glsl
TernaryFolding.glsl Optimize away same-value ternaries. 2022-04-07 19:37:00 +00:00
VectorScalarFolding.glsl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00
VectorVectorFolding.glsl Remove 0/x arithmetic simplification. 2021-08-24 19:18:41 +00:00