llvm / llvm/llvm-project

[clang][dataflow] Add option for simpler boolean model

Open
#224,638 0 comments 0 reactions 0 assignees View on GitHub
clang:dataflow
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Currently the CDF boolean model involves SAT queries, which are handled by the WatchedLiteralsSolver (or could also be handled with Z3 or in custom builds any other solver -- see issue #204593).

An old prototype https://github.com/llvm/llvm-project/pull/82950 adds an alternative boolean model that didn't require SAT queries. We could try to brush that up and make it a runtime/checker option.

Pros:
- fewer dependencies
- could be faster (need to benchmark)

Cons:
- the `allows` or `proves` queries are more conservative and wouldn't handle correlated branches (https://clang.llvm.org/extra/clang-tidy/checks/bugprone/unchecked-optional-access.html#ensure-that-a-value-exists-then-access-the-value-in-a-correlated-branch)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the current CDF boolean model and WatchedLiteralsSolver, then compare the alternative implementation in pull request #82950. Define how a runtime or checker option should select the model, benchmark both approaches, and verify the documented conservative behavior around correlated branches.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.