[llvm] r252878 - [SDAG] Introduce a new BITREVERSE node along with a corresponding LLVM intrinsic

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 16:32:05 PST 2016


On Thu, Nov 12, 2015 at 4:29 AM, James Molloy via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: jamesm
> Date: Thu Nov 12 06:29:09 2015
> New Revision: 252878
>
> URL: http://llvm.org/viewvc/llvm-project?rev=252878&view=rev
> Log:
> [SDAG] Introduce a new BITREVERSE node along with a corresponding LLVM intrinsic
>
> Several backends have instructions to reverse the order of bits in an integer. Conceptually matching such patterns is similar to @llvm.bswap, and it was mentioned in http://reviews.llvm.org/D14234 that it would be best if these patterns were matched in InstCombine instead of reimplemented in every different target.
>
> This patch introduces an intrinsic @llvm.bitreverse.i* that operates similarly to @llvm.bswap. For plumbing purposes there is also a new ISD node ISD::BITREVERSE, with simple expansion and promotion support.
>
> The intention is that InstCombine's BSWAP detection logic will be extended to support BITREVERSE too, and @llvm.bitreverse intrinsics emitted (if the backend supports lowering it efficiently).

Maybe worth mentioning in the release notes?

Thanks,
Hans


More information about the llvm-commits mailing list