[WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should...
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 19:48:29 +0000 (19:48 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 19:48:29 +0000 (19:48 +0000)
commit5b538fb0e21c4f59d24ec507bac81cbd5fcf9a8b
tree6fbeb8c373dc075501645070aecc6819229bee88
parent9cdccff72b49532cb49a09dd3005bb58b8a1611b
[WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should skip stdlib functions
https://bugs.webkit.org/show_bug.cgi?id=200510

Reviewed by Myles C. Maxfield.

We can skip walking the stdlib part of the AST in various semantic checking phases:
- checkRecursion: the stdlib does not have recursion
- checkTextureReferences: the stdlib does not have references to textures
- EscapedVariableCollector: this is used inside preserveVariableLifetimes, and
  the stdlib never escapes any variables.

This patch speeds up checkRecursion, checkTextureReferences, and preserveVariableLifetimes
by about 1ms each, leading to a 3ms compile time speedup in compute_boids.

* Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
(WebCore::WHLSL::TextureReferencesChecker::visit):
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::preserveVariableLifetimes):
(WebCore::WHLSL::EscapedVariableCollector::escapeVariableUse): Deleted.
(WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables): Deleted.
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp
Source/WebCore/Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp
Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp