summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/and.ll
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] fold a shifted bool zext to a select (2nd try)Sanjay Patel2019-10-151-2/+1
| | | | | | | | | | | | | | | | | | | | The 1st attempt at rL374828 inserted the code at the wrong position (outside of the constant-shift-amount block). Trying again with an additional test to verify const-ness. For a constant shift amount, add the following fold. shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0) https://rise4fun.com/Alive/IZ9 Fixes PR42257. Based on original patch by @zvi (Zvi Rackover) Differential Revision: https://reviews.llvm.org/D63382 llvm-svn: 374886
* Revert [InstCombine] fold a shifted bool zext to a selectSanjay Patel2019-10-141-1/+2
| | | | | | This reverts r374828 (git commit 1f40f15d54aac06421448b6de131231d2d78bc75) due to bot breakage llvm-svn: 374851
* [InstCombine] fold a shifted bool zext to a selectSanjay Patel2019-10-141-2/+1
| | | | | | | | | | | | | | | For a constant shift amount, add the following fold. shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0) https://rise4fun.com/Alive/IZ9 Fixes PR42257. Based on original patch by @zvi (Zvi Rackover) Differential Revision: https://reviews.llvm.org/D63382 llvm-svn: 374828
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-171-0/+839
| | | | | | | | 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-839/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [InstCombine] fix demanded-bits propagation for zext/truncSanjay Patel2018-01-171-3/+1
| | | | | | | | | I was comparing the demanded-bits implementations between InstCombine and TargetLowering as part of investigating questions in D42088 and noticed that this was wrong in IR. We were losing all of the prior known bits when we got back to the 'zext'. llvm-svn: 322662
* [InstCombine] add test to show hole in demanded bits; NFCSanjay Patel2018-01-171-0/+19
| | | | llvm-svn: 322660
* [InstCombine] Improve the expansion in SimplifyUsingDistributiveLaws to ↵Craig Topper2017-07-151-38/+22
| | | | | | | | | | | | | | | | | | | handle cases where one side doesn't simplify, but the other side resolves to an identity value Summary: If one side simplifies to the identity value for inner opcode, we can replace the value with just the operation that can't be simplified. I've removed a couple now unneeded special cases in visitAnd and visitOr. There are probably other cases I missed. Reviewers: spatel, majnemer, hfinkel, dberlin Reviewed By: spatel Subscribers: grandinj, llvm-commits, spatel Differential Revision: https://reviews.llvm.org/D35451 llvm-svn: 308111
* [InstCombine] Add test cases for (X & (Y | ~X)) -> (X & Y) where the not is ↵Craig Topper2017-07-151-0/+160
| | | | | | | | an inverted compare. NFC Do the same for (X | (Y & ~X)) -> (X | Y) llvm-svn: 308104
* [InstCombine] Move 4 test cases from a test that didn't use FileCheck and ↵Craig Topper2017-07-151-0/+48
| | | | | | merge them into a existing test file. NFC llvm-svn: 308103
* [InstCombine] fix typo in test comment; NFCSanjay Patel2017-05-101-1/+1
| | | | llvm-svn: 302669
* [InstCombine] consolidate more DeMorgan tests; NFCSanjay Patel2017-05-011-13/+0
| | | | llvm-svn: 301800
* [InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)Craig Topper2017-04-251-8/+2
| | | | | | | | The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed. Differential Revision: https://reviews.llvm.org/D32474 llvm-svn: 301316
* [InstCombine] Add test cases showing failures to handle commuted patterns ↵Craig Topper2017-04-251-0/+34
| | | | | | after tricking the operand complexity sorting. llvm-svn: 301296
* [InstCombine] add/move tests for and/or-of-icmps equality folds; NFCSanjay Patel2017-04-141-13/+0
| | | | llvm-svn: 300357
* [InstCombine] Extend some OR combines to support vectors.Craig Topper2017-04-091-8/+2
| | | | | | | | This adds support for these combines for vectors (X^C)|Y -> (X|Y)^C iff Y&C == 0 Y|(X^C) -> (X|Y)^C iff Y&C == 0 llvm-svn: 299822
* [InstCombine] Extend a canonicalization check to apply to vector constants too.Craig Topper2017-04-091-4/+4
| | | | llvm-svn: 299821
* [InstCombine] Add test cases to show missing support for vectors in an OR ↵Craig Topper2017-04-091-0/+42
| | | | | | combine. Also add the commuted versions. NFC llvm-svn: 299820
* [InstCombine] Support folding and/or/xor with a constant vector RHS into ↵Craig Topper2017-04-041-8/+5
| | | | | | | | | | selects and phis Currently we only fold with ConstantInt RHS. This generalizes to any Constant RHS. Differential Revision: https://reviews.llvm.org/D31610 llvm-svn: 299466
* [InstCombine] Add test cases for missing combines of phis with and/or/xor ↵Craig Topper2017-04-041-0/+68
| | | | | | with constant argument. NFC llvm-svn: 299460
* [InstCombine] Add more test cases for missing combines of selects with ↵Craig Topper2017-04-041-0/+31
| | | | | | and/or/xor with constant argument. NFC llvm-svn: 299450
* [InstCombine] use m_APInt to allow demanded bits analysis on splat constantsSanjay Patel2017-02-091-3/+2
| | | | llvm-svn: 294628
* [InstCombine] add test for demanded bits with splat vector constants; NFCSanjay Patel2017-02-091-0/+13
| | | | llvm-svn: 294625
* [InstCombine] fix operand-complexity-based canonicalization (PR28296)Sanjay Patel2017-02-031-1/+1
| | | | | | | | | | | | | | | | | | | The code comments didn't match the code logic, and we didn't actually distinguish the fake unary (not/neg/fneg) operators from arguments. Adding another level to the weighting scheme provides more structure and can help simplify the pattern matching in InstCombine and other places. I fixed regressions that would have shown up from this change in: rL290067 rL290127 But that doesn't mean there are no pattern-matching logic holes left; some combines may just be missing regression tests. Should fix: https://llvm.org/bugs/show_bug.cgi?id=28296 Differential Revision: https://reviews.llvm.org/D27933 llvm-svn: 294049
* [InstCombine] Fold ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2)David Majnemer2017-01-171-0/+46
| | | | | | | This further extends r292179 to support additional binary operators beyond subtraction. llvm-svn: 292238
* [InstCombine] Fold ((C1-zext(X)) & C2) -> zext((C1-X) & C2)David Majnemer2017-01-171-0/+11
| | | | | | | This is valid if C2 fits within the bitwidth of X thanks to two's complement modulo arithmetic. llvm-svn: 292179
* [InstCombine] allow vector types for constant folding / computeKnownBits ↵Sanjay Patel2016-09-161-0/+11
| | | | | | | | | | | | | | | | (PR24942) computeKnownBits() already works for integer vectors, so allow vector types when calling that from InstCombine. I don't think the change to use m_APInt in computeKnownBits is strictly necessary because we do check for ConstantVector later, but it's more efficient to handle the splat case without needing to loop on vector elements. This should work with InstSimplify, but doesn't yet, so I made that a FIXME comment on the test for PR24942: https://llvm.org/bugs/show_bug.cgi?id=24942 Differential Revision: https://reviews.llvm.org/D24677 llvm-svn: 281777
* [InstCombine] add tests to show type limitations of InsertRangeTest and callersSanjay Patel2016-08-301-2/+28
| | | | llvm-svn: 280175
* [InstCombine] use m_APInt to allow icmp eq (and X, C1), C2 folds for splat ↵Sanjay Patel2016-08-041-6/+2
| | | | | | constant vectors llvm-svn: 277762
* add tests for icmp vector foldsSanjay Patel2016-07-221-0/+24
| | | | llvm-svn: 276482
* [InstSimplify] analyze (optionally casted) icmps to eliminate obviously ↵Sanjay Patel2016-06-201-11/+0
| | | | | | | | | | | | | | | false logic (PR27869) By moving this transform to InstSimplify from InstCombine, we sidestep the problem/question raised by PR27869: https://llvm.org/bugs/show_bug.cgi?id=27869 ...where InstCombine turns an icmp+zext into a shift causing us to miss the fold. Credit to David Majnemer for a draft patch of the changes to InstructionSimplify.cpp. Differential Revision: http://reviews.llvm.org/D21512 llvm-svn: 273200
* [InstCombine] update to use FileCheck with autogenerated exact checkingSanjay Patel2016-06-201-143/+269
| | | | llvm-svn: 273173
* InstCombine: add more transformsDavid Majnemer2013-07-091-3/+3
| | | | | | | | | C1-X <u C2 -> (X|(C2-1)) == C1 C1-X >u C2 -> (X|C2) == C1 X-C1 <u C2 -> (X & -C2) == C1 X-C1 >u C2 -> (X & ~C2) == C1 llvm-svn: 185909
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-081-1/+1
| | | | llvm-svn: 81257
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-081-1/+1
| | | | | | of using llvm-as, now that opt supports this. llvm-svn: 81226
* Remove llvm-upgrade and update tests.Tanya Lattner2008-03-091-155/+181
| | | | llvm-svn: 48103
* For PR1319:Reid Spencer2007-04-151-0/+1
| | | | | | | Make use of the END. facility on all files > 1K so that we aren't wasting CPU cycles searching for RUN: lines that we'll never find. llvm-svn: 36059
* Regression is gone, don't try to find it on clean target.Reid Spencer2007-01-171-0/+228
llvm-svn: 33296
OpenPOWER on IntegriCloud