[all-commits] [llvm/llvm-project] e09813: [clang][dataflow] Move expensive solver asserts un...
Zeyi Xu via All-commits
all-commits at lists.llvm.org
Thu Jun 25 06:08:49 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e0981358efdf3c630d1921fd81ba55af5e406364
https://github.com/llvm/llvm-project/commit/e0981358efdf3c630d1921fd81ba55af5e406364
Author: Zeyi Xu <mitchell.xu2 at gmail.com>
Date: 2026-06-25 (Thu, 25 Jun 2026)
Changed paths:
M clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp
Log Message:
-----------
[clang][dataflow] Move expensive solver asserts under EXPENSIVE_CHECKS (#205715)
The watched-literal solver has a few invariant checks that run on every
solver iteration in assertion builds. Some of these checks rebuild and
iterate over the watched-literal state. This overhead is usually hidden,
but it becomes dominant for large flow-sensitive analyses.
While testing clang-tidy's `unchecked-optional-access` check on real
world projects (in this case, LLVM itself), we found there are a few
extreme slow analyses caused by this overhead.
| Time | File |
|---------|-----------------------------------------------------|
| 8235.7s | llvm-project/clang/utils/TableGen/RISCVVEmitter.cpp |
| 8197.2s | llvm-project/clang/lib/Driver/Multilib.cpp |
(Ran on a machine with Icelake 32cores + 128gb memory)
After moving these asserts to `EXPENSIVE_CHECKS`, the same files
complete in about 14.2 seconds and 12.2 seconds locally. That is roughly
a 580x improvement for `RISCVVEmitter.cpp` and a 673x improvement for
`Multilib.cpp`.
This can also affect clang-tidy pre-merge CI, because the pre-merge
configuration uses an assertions build and enables
`bugprone-unchecked-optional-access`.
Given this scale of improvement, I think these invariant checks are
better suited for `EXPENSIVE_CHECKS`. They remain available in dedicated
expensive-check builds, while avoiding a very large cost in regular
release+assertions builds.
Closes https://github.com/llvm/llvm-project/issues/205713
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list