summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/bitreverse-recognize.ll
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] Rewrite bswap/bitreverse handling completely.James Molloy2016-01-151-114/+0
| | | | | | | | | | | | | | There are several requirements that ended up with this design; 1. Matching bitreversals is too heavyweight for InstCombine and doesn't really need to be done so early. 2. Bitreversals and byteswaps are very related in their matching logic. 3. We want to implement support for matching more advanced bswap/bitreverse patterns like partial bswaps/bitreverses. 4. Bswaps are best matched early in InstCombine. The result of these is that a new utility function is created in Transforms/Utils/Local.h that can be configured to search for bswaps, bitreverses or both. InstCombine uses it to find only bswaps, CGP uses it to find only bitreversals. We can then extend the matching logic in one place only. llvm-svn: 257875
* [InstCombine] Make MatchBSwap also match bit reversalsJames Molloy2015-12-111-0/+114
MatchBSwap has most of the functionality to match bit reversals already. If we switch it from looking at bytes to individual bits and remove a few early exits, we can extend the main recursive function to match any sequence of ORs, ANDs and shifts that assemble a value from different parts of another, base value. Once we have this bit->bit mapping, we can very simply detect if it is appropriate for a bswap or bitreverse. llvm-svn: 255334
OpenPOWER on IntegriCloud