skia2/tests/sksl
John Stiles 345d72124d Eliminate inliner temporary variables for functions with a single exit.
When we determine that a function only contains a single return
statement, 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.

This dramatically simplifies the final optimized output from chains of
very simple inlined functions, which is a very common pattern for trees
of Skia fragment processors.

Change-Id: I6789064a321daf43db2e1cef4915f25ed74d6131
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344665
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-16 17:26:06 +00:00
..
blend Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00
errors Fix incorrect 'unreachable code' error in SkSL 2020-12-16 16:46:06 +00:00
fp Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00
glsl Replace array indexing on vector types with swizzles. 2020-12-07 21:16:40 +00:00
inliner Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00
intrinsics Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00
metal Improve Metal support for out parameters. 2020-12-09 21:13:57 +00:00
shared Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00
spirv Fix various SkSL errors that don't report a line number. 2020-12-14 16:11:13 +00:00
workarounds Eliminate inliner temporary variables for functions with a single exit. 2020-12-16 17:26:06 +00:00