[clang] [analyzer] Workaround for unintended slowdown (scope increase) (PR #136720)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 25 02:52:15 PDT 2025
balazs-benics-sonarsource wrote:
> 🤔 The version with the commit under review is surprisingly fast and I don't exactly know why. My most plausible theory is that [bb27d5e](https://github.com/llvm/llvm-project/commit/bb27d5e5c6b194a1440b8ac4e5ace68d0ee2a849) ("Don't assume third iteration") has two effects on the analysis runtime:
>
> * it inherently speeds up the analysis of loops (because some iterations are skipped);
> * it slows down the analysis because it affects the inlining heuristic and prevents functions from being placed on the inlining blacklist.
>
> This would explain why just reverting that commit (which undoes both effects) produces slower analysis than applying the commit under review (which undoes the slowdown and keeps the speedup).
This makes sense, and I was expecting even back in the day. But I was shocked that sometimes intuition fails, and we didn't check the RT for that patch. Now that you did the work, it leaves me in a lot more relaxed situation. Thanks!
https://github.com/llvm/llvm-project/pull/136720
More information about the cfe-commits
mailing list