aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorRyosuke Niwa <rniwa@webkit.org>2024-10-17 16:52:31 -0700
committerGitHub <noreply@github.com>2024-10-17 16:52:31 -0700
commit71b81e93d28c8db3f9cfa1d715c925a98ae4b153 (patch)
treec1a38673150951ec176cda2fd97dfc241396fa17 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent5033ea73bb01061feb09b3216c74619e1fbefdeb (diff)
downloadllvm-71b81e93d28c8db3f9cfa1d715c925a98ae4b153.zip
llvm-71b81e93d28c8db3f9cfa1d715c925a98ae4b153.tar.gz
llvm-71b81e93d28c8db3f9cfa1d715c925a98ae4b153.tar.bz2
[alpha.webkit.UncountedLocalVarsChecker] Recursive functions are erroneously treated as non-trivial (#110973)
This PR fixes the bug that alpha.webkit.UncountedLocalVarsChecker erroneously treats a trivial recursive function as non-trivial. This was caused by TrivialFunctionAnalysis::isTrivialImpl which takes a statement as an argument populating the cache with "false" while traversing the statement to determine its triviality within a recursive function in TrivialFunctionAnalysisVisitor's WithCachedResult. Because IsFunctionTrivial honors an entry in the cache, this resulted in the whole function to be treated as non-trivial. Thankfully, TrivialFunctionAnalysisVisitor::IsFunctionTrivial already handles recursive functions correctly so this PR applies the same logic to TrivialFunctionAnalysisVisitor::WithCachedResult by sharing code between the two functions. This avoids the cache to be pre-populated with "false" while traversing statements in a recurisve function.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions