[all-commits] [llvm/llvm-project] c76350: [analyzer] Fix StdLibraryFunctionsChecker performa...

Valeriy Savchenko via All-commits all-commits at lists.llvm.org
Tue Mar 9 23:44:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7635040ce0a546020cbcd9f2030817725bd7494
      https://github.com/llvm/llvm-project/commit/c7635040ce0a546020cbcd9f2030817725bd7494
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2021-03-10 (Wed, 10 Mar 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

  Log Message:
  -----------
  [analyzer] Fix StdLibraryFunctionsChecker performance issue

`initFunctionSummaries` lazily initializes a data structure with
function summaries for standard library functions.  It is called for
every pre-, post-, and eval-call events, i.e. 3 times for each call on
the path.  If the initialization doesn't find any standard library
functions in the translation unit, it will get re-tried (with the same
effect) many times even for small translation units.

For projects not using standard libraries, the speed-up can reach 50%
after this patch.

Differential Revision: https://reviews.llvm.org/D98244




More information about the All-commits mailing list