commit | 345d72124d35b7c434be7bd9b6b16a66fbd980e6 | [log] [tgz] |
---|---|---|
author | John Stiles <johnstiles@google.com> | Tue Dec 15 18:06:29 2020 -0500 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Wed Dec 16 17:26:06 2020 +0000 |
tree | cdef7cdb98164536ec4a2ecf323f3c5b96b7e1b5 | |
parent | e8e4aca955bc87732ada3dd42ec60f6b1a37443e [diff] |
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>