summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-eq-to-icmp-ule.ll
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] make icmp vector canonicalization safe for constant with undef ↵Sanjay Patel2019-10-291-1/+1
| | | | | | | | | | | | | | | | | elements This is a fix for: https://bugs.llvm.org/show_bug.cgi?id=43730 ...and as shown there, we have existing test cases that show potential miscompiles. We could just bail out for vector constants that contain any undef elements, or we can do as shown here: allow the transform, but replace the undefs with a safe value. For most of the tests shown, this results in a full splat constant (no undefs) which is probably a win for further IR analysis because we conservatively don't match undefs in most cases. Codegen can probably recover these kinds of undef lanes via demanded elements analysis if that's profitable. Differential Revision: https://reviews.llvm.org/D69519
* [NFC][InstCombine] Revisit canonicalize-constant-low-bit-mask-and-icmp-s* ↵Roman Lebedev2019-06-091-0/+21
| | | | | | | | | | | | | | | | | | tests in preparatio for PR42198. The `icmp sgt`/`icmp sle` variants are, too, miscompiles: https://rise4fun.com/Alive/JFNP https://rise4fun.com/Alive/jHvL A precondition 'x != 0' was forgotten by me. While ensuring test coverage for `-1`, also add test coverage for `0` mask. Mask `0` is allowed for all the folds, mask `-1` is allowed for all the folds with unsigned `icmp` pred. Constant mask `0` is missed though. https://bugs.llvm.org/show_bug.cgi?id=42198 llvm-svn: 362910
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-171-0/+190
| | | | | | | | The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
* Temporarily Revert "Add basic loop fusion pass."Eric Christopher2019-04-171-190/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [NFC][InstCombine] Add forgotten variable tests for ↵Roman Lebedev2018-07-141-0/+58
| | | | | | foldICmpWithLowBitMaskedVal() llvm-svn: 337094
* [InstCombine] Fold x & (-1 >> y) == x to x u<= (-1 >> y)Roman Lebedev2018-07-111-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: https://bugs.llvm.org/show_bug.cgi?id=38123 This pattern will be produced by Implicit Integer Truncation sanitizer, https://reviews.llvm.org/D48958 https://bugs.llvm.org/show_bug.cgi?id=21530 in unsigned case, therefore it is probably a good idea to improve it. https://rise4fun.com/Alive/Rny ^ there are more opportunities for folds, i will follow up with them afterwards. Caveat: this somehow exposes a missing opportunities in `test/Transforms/InstCombine/icmp-logical.ll` It seems, the problem is in `foldLogOpOfMaskedICmps()` in `InstCombineAndOrXor.cpp`. But i'm not quite sure what is wrong, because it calls `getMaskedTypeForICmpPair()`, which calls `decomposeBitTestICmp()` which should already work for these cases... As @spatel notes in https://reviews.llvm.org/D49179#1158760, that code is a rather complex mess, so we'll let it slide. Reviewers: spatel, craig.topper Reviewed By: spatel Subscribers: yamauchi, majnemer, t.p.northover, llvm-commits Differential Revision: https://reviews.llvm.org/D49179 llvm-svn: 336834
* [NFC][InstCombine] Tests for x & (-1 >> y) == x -> x u<= (-1 >> y) foldRoman Lebedev2018-07-111-0/+137
https://bugs.llvm.org/show_bug.cgi?id=38123 This pattern will be produced by Implicit Integer Truncation sanitizer, https://reviews.llvm.org/D48958 https://bugs.llvm.org/show_bug.cgi?id=21530 in unsigned case, therefore it is probably a good idea to improve it. https://rise4fun.com/Alive/Rny llvm-svn: 336796
OpenPOWER on IntegriCloud