[llvm] r257875 - [InstCombine] Rewrite bswap/bitreverse handling completely.

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 09:59:02 PST 2016


It was suggested that this be merged to 3.8. David, I think you're the
code owner here; OK for merge?

On Fri, Jan 15, 2016 at 1:20 AM, James Molloy via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: jamesm
> Date: Fri Jan 15 03:20:19 2016
> New Revision: 257875
>
> URL: http://llvm.org/viewvc/llvm-project?rev=257875&view=rev
> Log:
> [InstCombine] Rewrite bswap/bitreverse handling completely.
>
> 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.


More information about the llvm-commits mailing list