summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/ConstantRangeTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ConstantRange] Add support of mul in makeGuaranteedNoWrapRegion.Tim Shen2018-06-261-0/+99
| | | | | | | | | | | | Summary: This is trying to add support for r334428. Reviewers: sanjoy Subscribers: jlebar, hiraditya, bixia, llvm-commits Differential Revision: https://reviews.llvm.org/D48399 llvm-svn: 335646
* [ConstantRange] Support for ashr in ConstantRange computationMax Kazantsev2017-12-181-0/+27
| | | | | | | | | | | Extend the ConstantRange implementation to compute the range of possible values resulting from an arithmetic right shift operation. There will be a follow up patch to leverage this constant range infrastructure in LazyValueInfo. Patch by Surya Kumari Jangala! Differential Revision: https://reviews.llvm.org/D40881 llvm-svn: 320976
* [ConstantRange] Support subtraction in makeGuaranteedNoWrapRegion.Joel Galenson2017-12-051-0/+139
| | | | | | | | Previously ConstantRange::makeGuaranteedNoWrapRegion only handled addition. This adds support for subtraction. Differential Revision: https://reviews.llvm.org/D40036 llvm-svn: 319806
* [ConstantRange] Add another truncate unittest for wrapped set staying a ↵Craig Topper2017-06-041-0/+4
| | | | | | wrapped set. llvm-svn: 304695
* [ConstantRange] Add a few more truncate unittests.Craig Topper2017-06-041-0/+12
| | | | llvm-svn: 304694
* [ConstantRange] Add missing result check to the ConstantRange::truncate test.Craig Topper2017-06-041-0/+1
| | | | llvm-svn: 304693
* [ConstantRange] Fix what appear to be copy and paste mistakes in the unittest.Craig Topper2017-05-151-2/+2
| | | | llvm-svn: 303033
* [ConstantRange] Fix the early out in ConstantRange::multiply for positive ↵Craig Topper2017-05-101-1/+1
| | | | | | | | | | numbers to really do what the comment says r271020 added an early out to skip the signed multiply portion of ConstantRange::multiply. The comment says we don't need to do signed multiply if the range is only positive numbers, but the implemented check only ensures that the start of the range is positive. It doesn't look at the end of the range. This patch checks the end of the range instead. Because Upper is one more than the end we have to see if its positive or if its one past the last positive number. llvm-svn: 302717
* [ConstantRange] Add test case showing a case where we pick too large of a ↵Craig Topper2017-05-101-0/+5
| | | | | | range for multiply after r271020. llvm-svn: 302700
* [APInt] Cast more calls to add/sub/mul overflow functions to void. I missed ↵Craig Topper2017-04-191-4/+4
| | | | | | the unittests in r300758. llvm-svn: 300773
* Introduce ConstantRange.addWithNoSignedWrapArtur Pilipenko2016-10-191-0/+26
| | | | | | | | | | To be used by upcoming change to IndVarSimplify Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D25732 llvm-svn: 284597
* [ConstantRange] Make getEquivalentICmp smarterSanjoy Das2016-10-021-0/+45
| | | | | | | | | | | This change teaches getEquivalentICmp to be smarter about generating ICMP_NE and ICMP_EQ predicates. An earlier version of this change was landed as rL283057 which had a use-after-free bug. This new version has a fix for that bug, and a (C++ unittests/) test case that would have triggered it rL283057. llvm-svn: 283078
* Revert r283057 and r283058Sanjoy Das2016-10-021-31/+0
| | | | | | | | | | | They've broken the sanitizer-bootstrap bots. Reverting while I investigate. Original commit messages: r283057: "[ConstantRange] Make getEquivalentICmp smarter" r283058: "[SCEV] Rely on ConstantRange instead of custom logic; NFCI" llvm-svn: 283062
* [ConstantRange] Make getEquivalentICmp smarterSanjoy Das2016-10-021-0/+31
| | | | | | | This change teaches getEquivalentICmp to be smarter about generating ICMP_NE and ICMP_EQ predicates. llvm-svn: 283057
* [ConstantRange] Add an getEquivalentICmp helperSanjoy Das2016-05-191-0/+46
| | | | | | | Currently only its unit test uses it, but this will be used in a later change to simplify some logic in the GuardWidening pass. llvm-svn: 270018
* [ConstantRange] Rename test; NFCSanjoy Das2016-03-031-1/+1
| | | | llvm-svn: 262640
* [ConstantRange] Generalize makeGuaranteedNoWrapRegion to work on rangesSanjoy Das2016-03-031-0/+57
| | | | | | | This will be used in a later patch to ScalarEvolution. Right now only the unit tests exercise the newly added code. llvm-svn: 262637
* [ConstantRange] Add umin/smin operatorsPhilip Reames2016-02-261-0/+39
| | | | | | | | This was split off from http://reviews.llvm.org/D17184. Reviewed by: Sanjoy llvm-svn: 262080
* [ConstantRange] Rename a method and add more docSanjoy Das2016-02-221-5/+5
| | | | | | | | Rename makeNoWrapRegion to a more obvious makeGuaranteedNoWrapRegion, and add a comment about the counter-intuitive aspects of the function. This is to help prevent cases like PR26628. llvm-svn: 261532
* [IR] Add a `makeNoWrapRegion` method to `ConstantRange`Sanjoy Das2015-10-221-0/+52
| | | | | | | | | | | | Summary: This will be used in a future change to ScalarEvolution. Reviewers: hfinkel, reames, nlewycky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13612 llvm-svn: 250975
* [ConstantRange] Split makeICmpRegion in two.Sanjoy Das2015-03-181-3/+55
| | | | | | | | | | | | | | | | | | | | Summary: This change splits `makeICmpRegion` into `makeAllowedICmpRegion` and `makeSatisfyingICmpRegion` with slightly different contracts. The first one is useful for determining what values some expression //may// take, given that a certain `icmp` evaluates to true. The second one is useful for determining what values are guaranteed to //satisfy// a given `icmp`. Reviewers: nlewycky Reviewed By: nlewycky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8345 llvm-svn: 232575
* [ConstantRange] Teach multiply to be cleverer about signed ranges.James Molloy2015-03-061-0/+7
| | | | | | | | | | | | | Multiplication is not dependent on signedness, so just treating all input ranges as unsigned is not incorrect. However it will cause overly pessimistic ranges (such as full-set) when used with signed negative values. Teach multiply to try to interpret its inputs as both signed and unsigned, and then to take the most specific (smallest population) as its result. llvm-svn: 231483
* [C++11] Use 'nullptr'.Craig Topper2014-06-081-4/+4
| | | | llvm-svn: 210442
* [Modules] Move the ConstantRange class into the IR library. This isChandler Carruth2014-03-041-0/+512
a bit surprising, as the class is almost entirely abstracted away from any particular IR, however it encodes the comparsion predicates which mutate ranges as ICmp predicate codes. This is reasonable as they're used for both instructions and constants. Thus, it belongs in the IR library with instructions and constants. llvm-svn: 202838
OpenPOWER on IntegriCloud