This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Unsoundly treat "Unknown" as "Equivalent" in widening.
ClosedPublic

Authored by ymandel on Sep 1 2023, 6:01 AM.

Details

Summary

This change makes widening act the same as equivalence checking. When the
analysis does not provide an answer regarding the equivalence of two distinct
values, the framework treats them as equivalent. This is an unsound choice that
enables convergence.

Diff Detail

Event Timeline

ymandel created this revision.Sep 1 2023, 6:01 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: martong. · View Herald Transcript
ymandel requested review of this revision.Sep 1 2023, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2023, 6:01 AM
mboehme accepted this revision.Sep 4 2023, 3:05 AM
mboehme added inline comments.
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
53

Did you mean "hack"?

If you did indeed mean "hook" -- I think it's not strictly speaking a hook, as there's no way to change the behavior here (i.e. install a different handler). Maybe just "this function enables unsoundness..."?

This revision is now accepted and ready to land.Sep 4 2023, 3:05 AM
ymandel updated this revision to Diff 556051.Sep 6 2023, 9:59 AM

fix typo

ymandel marked an inline comment as done.Sep 6 2023, 9:59 AM
ymandel added inline comments.
clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
53

yes, "hack". Good catch. :)

ymandel marked an inline comment as done.Sep 6 2023, 12:59 PM

Gabor -- do you want a chance to review (given that it's a non-trivial change to the infrastructure)?

xazax.hun accepted this revision.Sep 6 2023, 1:15 PM

Sorry for the late review. This looks good to me, but I hope we will be able to undo it soon :)

Sorry for the late review. This looks good to me, but I hope we will be able to undo it soon :)

Thanks! Np, and agreed. I think we have a clear path towards dropping the unsoundness altogether. Up next. :)

This revision was landed with ongoing or failed builds.Sep 7 2023, 12:10 PM
This revision was automatically updated to reflect the committed changes.