summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/fsh.ll
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] reduce funnel-shift i16 X, X, 8 to bswap XSanjay Patel2019-06-241-3/+9
| | | | | | | | | | Prefer the more exact intrinsic to remove a use of the input value and possibly make further transforms easier (we will still need to match patterns with funnel-shift of wider types as pieces of bswap, especially if we want to canonicalize to funnel-shift with constant shift amount). Discussed in D46760. llvm-svn: 364187
* [InstCombine] add tests for funnel-shift to bswap; NFCSanjay Patel2019-06-241-0/+37
| | | | llvm-svn: 364184
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-171-0/+638
| | | | | | | | 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-638/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [InstCombine] Prune fshl/fshr with masked operandsNikita Popov2019-04-161-12/+8
| | | | | | | | | | | | | | | | If a constant shift amount is used, then only some of the LHS/RHS operand bits are demanded and we may be able to simplify based on that. InstCombineSimplifyDemanded already had the necessary support for that, we just weren't calling it with fshl/fshr as root. In particular, this allows us to relax some masked funnel shifts into simple shifts, as shown in the tests. Patch by Shawn Landden. Differential Revision: https://reviews.llvm.org/D60660 llvm-svn: 358515
* [InstCombine] Add tests for fshl/fshr with masked operands; NFCNikita Popov2019-04-161-0/+81
| | | | | | | | | | Baseline tests for D60660. Patch by Shawn Landden. Differential Revision: https://reviews.llvm.org/D60688 llvm-svn: 358514
* [InstCombine] allow general vector constants for funnel shift to shift ↵Sanjay Patel2019-03-181-4/+4
| | | | | | | | | | | | | transforms Follow-up to: rL356338 rL356369 We can calculate an arbitrary vector constant minus the bitwidth, so there's no need to limit this transform to scalars and splats. llvm-svn: 356372
* [InstCombine] extend rotate-left-by-constant canonicalization to funnel shiftSanjay Patel2019-03-181-5/+5
| | | | | | | | | | | Follow-up to: rL356338 Rotates are a special case of funnel shift where the 2 input operands are the same value, but that does not need to be a restriction for the canonicalization when the shift amount is a constant. llvm-svn: 356369
* [InstCombine] add funnel shift tests with arbitrary constants; NFCSanjay Patel2019-03-181-8/+44
| | | | llvm-svn: 356367
* [InstCombine] canonicalize rotate right by constant to rotate leftSanjay Patel2019-03-171-4/+4
| | | | | | | | | | | This was noted as a backend problem: https://bugs.llvm.org/show_bug.cgi?id=41057 ...and subsequently fixed for x86: rL356121 But we should canonicalize these in IR for the benefit of all targets and improve IR analysis such as CSE. llvm-svn: 356338
* [InstCombine] add tests for rotate by constant using funnel intrinsics; NFCSanjay Patel2019-03-171-0/+36
| | | | llvm-svn: 356337
* [InstCombine] remove duplicate testsSanjay Patel2019-03-141-36/+0
| | | | | | These got accidentally doubled with rL356191. llvm-svn: 356195
* [InstCombine] canonicalize funnel shift constant shift amount to be modulo ↵Sanjay Patel2019-03-141-6/+29
| | | | | | | | | | | | | | | bitwidth The shift argument is defined to be modulo the bitwidth, so if that argument is a constant, we can always reduce the constant to its minimal form to allow better CSE and other follow-on transforms. We need to be careful to ignore constant expressions here, or we will likely infinite loop. I'm adding a general vector constant query for that case. Differential Revision: https://reviews.llvm.org/D59374 llvm-svn: 356192
* [InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFCSanjay Patel2019-03-141-0/+36
| | | | llvm-svn: 356191
* [InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFCSanjay Patel2019-03-141-0/+36
| | | | llvm-svn: 356175
* [InstCombine] add tests for rotate/bswap equality; NFCSanjay Patel2018-11-271-0/+23
| | | | llvm-svn: 347618
* [InstCombine] Determine demanded and known bits for funnel shiftsNikita Popov2018-11-241-19/+34
| | | | | | | | | | | | | | Support funnel shifts in InstCombine demanded bits simplification. If the shift amount is constant, we can determine both the demanded bits of the operands, as well as the known bits of the result. If one of the operands has no demanded bits, it will be replaced by undef and the funnel shift will be simplified into a simple shift due to the simplifications added in D54778. Differential Revision: https://reviews.llvm.org/D54869 llvm-svn: 347515
* [InstCombine] Simplify funnel shift with zero/undef operand to shiftNikita Popov2018-11-231-9/+45
| | | | | | | | | | | | | | | | | | | | The following simplifications are implemented: * `fshl(X, 0, C) -> shl X, C%BW` * `fshl(X, undef, C) -> shl X, C%BW` (assuming undef = 0) * `fshl(0, X, C) -> lshr X, BW-C%BW` * `fshl(undef, X, C) -> lshr X, BW-C%BW` (assuming undef = 0) * `fshr(X, 0, C) -> shl X, (BW-C%BW)` * `fshr(X, undef, C) -> shl X, BW-C%BW` (assuming undef = 0) * `fshr(0, X, C) -> lshr X, C%BW` * `fshr(undef, X, C) -> lshr, X, C%BW` (assuming undef = 0) The simplification is only performed if the shift amount C is constant, because we can explicitly compute C%BW and BW-C%BW in this case. Differential Revision: https://reviews.llvm.org/D54778 llvm-svn: 347505
* [InstCombine] Add tests for funnel shift with zero operand; NFCNikita Popov2018-11-211-0/+36
| | | | | | These are additional baseline tests for D54778. llvm-svn: 347414
* [InstCombine] add tests for funnel shifts; NFCSanjay Patel2018-11-201-0/+177
| | | | | | | | These are included in D54666, so adding them first with baseline results. Patch by: @nikic (Nikita Popov) llvm-svn: 347333
* [InstCombine] fold funnel shift amount based on demanded bitsSanjay Patel2018-11-131-14/+10
| | | | | | | | | | | | | | The shift amount of a funnel shift is modulo the scalar bitwidth: http://llvm.org/docs/LangRef.html#llvm-fshl-intrinsic ...so we can use demanded bits analysis on that operand to simplify it when we have a power-of-2 bitwidth. This is another step towards canonicalizing {shift/shift/or} to the intrinsics in IR. Differential Revision: https://reviews.llvm.org/D54478 llvm-svn: 346814
* [InstCombine] add tests for funnel shift demanded bits; NFCSanjay Patel2018-11-131-0/+147
llvm-svn: 346762
OpenPOWER on IntegriCloud