[PATCH] D117680: [InstCombine] Fold bswap(shl(x, C)) -> and(x, 255)

Paweł Bylica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 07:07:24 PST 2022


chfast updated this revision to Diff 401631.
chfast added a comment.

[InstCombine] Simplify bswap -> shift

Simplify bswap(x) to shl(x) or lshr(x) if x has at most 8 (byte-size)
low/high active bits.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117680/new/

https://reviews.llvm.org/D117680

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/test/Transforms/InstCombine/bswap-fold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117680.401631.patch
Type: text/x-patch
Size: 7649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220120/6cd162b1/attachment.bin>


More information about the llvm-commits mailing list