[PATCH] D118012: [DAGCombiner][RISCV] Canonicalize (bswap(bitreverse(x))->bitreverse(bswap(x)).

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 23 19:25:31 PST 2022


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon, efriedma.
Herald added subscribers: VincentWu, luke957, achieveartificialintelligence, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

If the bitreverse gets expanded, it will introduce a new bswap. By
putting a bswap before the bitreverse, we can ensure it gets cancelled
out when this happens.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118012

Files:
  llvm/test/CodeGen/RISCV/bswap-bitreverse-ctlz-cttz-ctpop.ll
  llvm/test/CodeGen/RISCV/rv32zbp.ll
  llvm/test/CodeGen/RISCV/rv64zbp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118012.402384.patch
Type: text/x-patch
Size: 20256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220124/8326153b/attachment.bin>


More information about the llvm-commits mailing list