This patch adds an initial implementation for sign analysis, with the
following lattice (T: top, N: negative, Z: zero, P: positive, B: bottom):
T / | \ N Z P \ | / B
The lattice is implemented with BoolValue properties attached to other
Values.
Paths
| Differential D136668
[clang][dataflow] Add initial sign analysis ClosedPublic Authored by martong on Oct 25 2022, 2:04 AM.
Details Summary This patch adds an initial implementation for sign analysis, with the T / | \ N Z P \ | / B The lattice is implemented with BoolValue properties attached to other
Diff Detail
Event TimelineComment Actions Nice!! Just nits. At a high level, I'm a little concerned about this as a demo, since I wouldn't recommend this implementation in practice (for various reasons, e.g. I would encode with 2 booleans since there are only 3 values). But, I think this approach has the advantage of clarity over optimized approaches. It might be worth pointing this out in comments at places where you made a decision for purposes of clarity/readability, if any come to mind.
This revision is now accepted and ready to land.Oct 25 2022, 11:05 AM Comment Actions
Okay, thanks again for the review! I've changed the comments for the file, where I describe these reasons about using 3 booleans.
This revision was landed with ongoing or failed builds.Oct 26 2022, 6:20 AM Closed by commit rG93ce23adb548: [clang][dataflow] Add initial sign analysis (authored by martong). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 470418 clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
|
please indicate ownership in comment