Infer range using associated unequal symbols from DisequalityMap.
Example:
if(x == 42) if(x != y) y; // [-2147483648, 41]U[43, 2147483647]
Differential D131006
[analyzer] Use DisequalityMap while inferring constraints ASDenysPetrov on Aug 2 2022, 11:45 AM. Authored by
Details Infer range using associated unequal symbols from DisequalityMap. if(x == 42) if(x != y) y; // [-2147483648, 41]U[43, 2147483647] NOTE: Currently, this revision causes test failure due to assertion in related to IteratorModeling.cpp in relateSymbols on line
assert(isa<SymIntExpr>(CompSym) && "Symbol comparison must be a SymIntExpr`");`. It needs to be fixed in some way before loading. The revision is exposed to show the motivation for D130372.
Diff Detail
Event TimelineComment Actions Awesome!
Comment Actions Thank you!
Comment Actions @martong My idea will only work with concrete ints but not ranges and it is already implemented in RangeConstraintManager in the snippet you mentioned (ConstraintAssignor::assign). I'm sorry for the lost time. P.S. The best I can do is just to add more tests for this. Created D131514 instead. |
unite should be working with an empty set as well, shouldn't it?