-
Notifications
You must be signed in to change notification settings - Fork 274
Vsd - widening during abstract object merge #6046
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
Vsd - widening during abstract object merge #6046
Conversation
a5477ee
to
d18bd36
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6046 +/- ##
===========================================
+ Coverage 67.40% 75.35% +7.94%
===========================================
Files 1157 1454 +297
Lines 95236 160914 +65678
===========================================
+ Hits 64197 121253 +57056
- Misses 31039 39661 +8622
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
713d2c1
to
7ec0228
Compare
f910b7b
to
37622eb
Compare
8152899
to
b308015
Compare
75fad1f
to
0308353
Compare
fca209a
to
6609a73
Compare
Eliminate boolean by-ref out parameter, instead returning a simple struct holding the merged object, and the modified flag.
It has been made redundant by the VSD changes over the past few months, and its continued presence is simply now confusing.
Consequently we can remove value_set_abstract_objectt::write and value_set_*::resolve_new_values. Added UNREACHABLE assertion in abstract_value_objectt::write should this every change (deliverately or otherwise).
No longer convert large value sets into an interval.
Also should_widen to could_widen - it's a request not an instruction
Extends upper and/or lower bound by the width of the interval. Does not widen in lhs value would be unchanged in non-widening merge - ie only widens if interval is extended by the merge.
Stripped out conversion to interval. Trying to get a little more sophisticated in our compaction.
If the size of the set is large, if there are any intervals in the set, try merging values into them.
Generate two intervals covering the upper and lower part of the value sets range of values, then merge values into those.
If added intervals don't reduce the size of the set, widen intervals towards the middle of the range, and repeat.
If the range of the merged value_set is no wider than the original object, no widening takes place. Otherwise, both the upper and lower boundary value can be extended, if the merged-in value extends in that direction.
Only collapse constants or intervals which overlap the extended upper or lower bound. Don't perform a general compact, unless the set has become large.
6609a73
to
743b047
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the PR is large, it seems the changes are mostly pretty straight-forward and a lot of it is tracing the extra parameter to merge through the various interfaces.
unit/analyses/variable-sensitivity/value_set_abstract_object/widening_merge.cpp
Outdated
Show resolved
Hide resolved
Simple variable, array element, and field in a structure. They all compact.
743b047
to
48146e0
Compare
Implements widening during abstract object merges.
Widening during a merge is determined by the
trace_ptrt
locations passed intovariable_sensitivity_domaint::merge
. When widening should occur hasn't been changed, what this PR does is actually try and widen when requested.If a merge result is unmodified, no widening will take place.
Constants don't need to be widened - rather, they already do because they go TOP.
For intervals, we consider which bound is being extended by the merge then extend that further out by the width of the interval. Eg.
If the merge extends both upper and lower bounds, we extend at both ends.
For value-sets, a similar mechanism is applied. If the upper or lower value in the set has changed in the merge, we extend that further, either by replacing a constant value with an interval or by extending the interval. Eg.
This PR also includes value-set compacting. When a value-set becomes large, that is has more than value_set_abstract_objectt::max_value_set_size elements, it is compacted. This has two stages
If the value-set is still too large, we move to the second stage