This is an archive of the discontinued LLVM Phabricator instance.

[dataflow] use true/false literals in formulas, rather than variables
ClosedPublic

Authored by sammccall on Jun 21 2023, 5:08 PM.

Details

Summary

And simplify formulas containing true/false
It's unclear to me how useful this is, it does make formulas more
conveniently self-contained now (we can usefully print them without
carrying around the "true/false" labels)

(while here, simplify !!X to X, too)

Diff Detail

Event Timeline

sammccall created this revision.Jun 21 2023, 5:08 PM
Herald added a project: Restricted Project. · View Herald Transcript
sammccall requested review of this revision.Jun 21 2023, 5:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 5:08 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xazax.hun accepted this revision.Jun 23 2023, 2:07 AM
This revision is now accepted and ready to land.Jun 23 2023, 2:07 AM
gribozavr2 accepted this revision.Jun 30 2023, 12:04 PM
gribozavr2 added a subscriber: gribozavr2.
gribozavr2 added inline comments.
clang/include/clang/Analysis/FlowSensitive/Formula.h
74

castAsLiteral() ?

clang/unittests/Analysis/FlowSensitive/TestingSupport.h
485
This revision was landed with ongoing or failed builds.Jul 5 2023, 5:07 AM
This revision was automatically updated to reflect the committed changes.
sammccall reopened this revision.Jul 15 2023, 9:08 AM

(this was reverted, I want to reland sometime, but there's a bad interaction with a bug in nullability analysis)

This revision is now accepted and ready to land.Jul 15 2023, 9:08 AM
dyung added a subscriber: dyung.Sep 22 2023, 10:32 AM

Hi @sammccall, your change seems to be causing a test failure on several bots, can you take a look and revert if you need time to investigate?

******************** TEST 'Clang-Unit :: Analysis/FlowSensitive/./ClangAnalysisFlowSensitiveTests/8/35' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/clang/unittests/Analysis/FlowSensitive/./ClangAnalysisFlowSensitiveTests-Clang-Unit-1681597-8-35.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=35 GTEST_SHARD_INDEX=8 /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/clang/unittests/Analysis/FlowSensitive/./ClangAnalysisFlowSensitiveTests
--
Script:
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/clang/unittests/Analysis/FlowSensitive/./ClangAnalysisFlowSensitiveTests --gtest_filter=BoolValueDebugStringTest.ComplexBooleanWithSomeNames
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp:111: Failure
Value of: Actual
Expected: is equal to "((Y & V2) | (X | V3))"
  Actual: "((Y & V3) | (X | V2))"
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp:111
Value of: Actual
Expected: is equal to "((Y & V2) | (X | V3))"
  Actual: "((Y & V3) | (X | V2))"
********************

Some affected bots: