- User Since
- May 17 2021, 1:21 PM (65 w, 1 d)
Mon, Jul 18
Rebase and fix comments
Considering @ASDenysPetrov 's example of LHS = [1, 2] U [8, 9] and RHS = [5, 6], I constructed a test case as following:
Remove filling gaps and convert, use castTo, and add tests for short-ushort,
Jul 15 2022
The coverage showing unreachability of VisitBinaryOperator<BO_NE> for concrete integer cases.
Add concrete tests for same and different types
Jul 11 2022
I was busy with other stuff. I will take a look at it now.
Apr 10 2022
Apr 7 2022
Fix comments and rebase
Apr 6 2022
@steakhal apologies for holding onto this for so long. I managed to fix previously untestable test cases. The issue was that I was building expressions as (u1 != u2) != 0 and the solver was canonicalizing this to an equivalent BO_EQ expression. That's why, it wasn't reaching VisitBinaryOperator<BO_NE>(). So I changed all tests as following: (u1 != u2) (removing the latter != 0 part. Also, I utilized the getConcreteValue() for checking of single APSInt in the RangeSets.
Fix test cases to make them reachable via VisiBinaryOperator<BO_NE> and using getConcreteValue()
Mar 2 2022
Buildbots are happy. I think we can land this. @steakhal do you mind landing it?
Mar 1 2022
I rebased to see if it satisfies the buildbot.
Feb 28 2022
This patch fixes #53967.
Nov 29 2021
Closing this as this is mistakenly a duplicate of existing differential D112621.
I have made few changes:
Fix comparison between different types and add a test to check it
Oct 27 2021
@steakhal @martong This patch solves the comparison between different types by bypassing the RangeSets first to VisitBinaryOperator which coarses/converts, and then only it checks for any True/False ranges via comparison. This is similar to what happens with BO_Rem, BO_And etc. as well.
Oct 23 2021
Gentle ping! I think landing it will make collecting analyzer information easier (in terms of faster build) as more (appropriate) cmake options can be passed via cmdline.
Based on the information from debugger, the logs show RangeSets [0, 255] and [INT_MIN, 0] from different types are causing the failure.
I tried producing a compact test case. The essential part is the comparison between different types, as in this case unsigned int and int. In other binary operators (BO_And, BO_Rem, etc.), this gets handled by coarsing RangeSets to Ranges and converting those Ranges to resulting type for comparison. This is missing in BO_NE. I suppose, this may be the reason behind the signedness mismatch.
Oct 22 2021
I have received a failed build on clang-ppc64be-linux (https://lab.llvm.org/buildbot/#/builders/52/builds/11704). Although, I haven't verified the commit. Is there something wrong with this commit? Is the function VisitBinaryOperator<BO_NE> reachable?
Oct 1 2021
I'll take a look at this over the weekend.
Sep 30 2021
Sep 29 2021
Apply mentioned edits in testcases
Sep 28 2021
The pre-merge checks fail due to the patch being unable to get applied. The troubleshooting suggest to update the patch via arc diff `git merge-base HEAD origin` --update D106102 and it would include all local changes into that patch. Shouldn't I avoid including all local changes, as some local changes are still WIP?
Move method to a specialized template for VisitBinaryOperator
Sep 25 2021
@vsavchenko should we land this?
Upgrade cmake to 3.21.3
Sep 24 2021
I haven't tried specializing that VisitBinaryOperator method which converts Ranges from RangeSets (as @vsavchenko mentioned). Should this case for NE stay here in the switch or move?
Aug 3 2021
I have updated the proof for Add: https://gist.github.com/weirdsmiley/ad6a9dbf3370e96d29f9e90068931d25
Fix unrelated commits mess up!
Fix test comments
Aug 2 2021
Fixing another broken dependency packages error.
upgrade cmake-3.21.0 to cmake-3.21.1
Jul 20 2021
Here is the proof using Z3: https://gist.github.com/weirdsmiley/8a35a0e1f55f310e3566cbd47555491a
Here is the proof of correctness of the algorithm using Z3: https://gist.github.com/weirdsmiley/ad6a9dbf3370e96d29f9e90068931d25
Jul 16 2021
Jul 15 2021
Jul 6 2021
Pass commands through settings instead of rest
Jul 5 2021
Restore global cmake command
Jul 2 2021
Replace literal-value 0 with APSInt Zero
Remove redundant getAPSIntType calls
Replace literal-value 0 with APSInt Zero
Merge conditionals with similar block and add test for one overflow on Tmax-side
Jul 1 2021
Jun 25 2021
Jun 24 2021
Add tests for overflows on both ends
Fix issues involving usage of uadd_ov and family of functions
Jun 23 2021
Fix issues involving cases for unsigned type and add tests
I am working on debugging those 3 cases.
Jun 22 2021
Regarding the tweakings in constant-folding.c, I have refrained from using cases which were resulting in UNKNOWN assertions as they were the primary reason for constraints being propagated.
Added updated logic for reasoning using number of overflows. Also, changed a couple of tests which were leading to unwanted constriants being propagated further.
Jun 21 2021
Jun 18 2021
The diff fixes all invalid assertion issues and also reasons about the cases where Min > Max.