Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][dataflow] Simplify flow conditions displayed in HTMLLogger. #70848

Merged
merged 2 commits into from
Nov 7, 2023

Commits on Oct 31, 2023

  1. [clang][dataflow] Simplify flow conditions displayed in HTMLLogger.

    This can make the flow condition significantly easier to interpret; see below
    for an example.
    
    I had hoped that adding the simplification as a preprocessing step before the
    SAT solver (in `DataflowAnalysisContext::querySolver()`) would also speed up SAT
    solving and maybe even eliminate SAT solver timeouts, but in my testing, this
    actually turns out to be a pessimization. It appears that these simplifications
    are easy enough for the SAT solver to perform itself.
    
    Nevertheless, the improvement in debugging alone makes this a worthwhile change.
    
    Example of flow condition output with these changes:
    
    ```
    Flow condition token: V37
    Constraints:
    (V16 = (((V15 & (V19 = V12)) & V22) & V25))
    (V15 = ((V12 & ((V14 = V9) | (V14 = V4))) & (V13 = V14)))
    True atoms: (V0, V1, V2, V5, V6, V7, V29, V30, V32, V34, V35, V37)
    False atoms: (V3, V8, V17)
    Equivalent atoms:
    (V11, V15)
    
    Flow condition constraints before simplification:
    V37
    ((!V3 & !V8) & !V17)
    (V37 = V34)
    (V34 = (V29 & (V35 = V30)))
    (V29 = (((V16 | V2) & V32) & (V30 = V32)))
    (V16 = (((V15 & (V19 = V12)) & V22) & V25))
    (V15 = V11)
    (V11 = ((((V7 | V2) & V12) & ((V7 & (V14 = V9)) | (V2 & (V14 = V4)))) & (V13 = V14)))
    (V2 = V1)
    (V1 = V0)
    V0
    (V7 = V6)
    (V6 = V5)
    (V5 = V2)
    ```
    martinboehme committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    7ec1f2d View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. Configuration menu
    Copy the full SHA
    ef4ec02 View commit details
    Browse the repository at this point in the history