[PATCH] D118007: [SelectionDAG][RISCV] Teach getNode to fold bswap(bswap(x))->x.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 23 13:55:32 PST 2022


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, efriedma.
Herald added subscribers: VincentWu, luke957, achieveartificialintelligence, vkmr, frasercrmck, ecnelises, 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, hiraditya.
craig.topper requested review of this revision.
Herald added subscribers: eopXD, MaskRay.
Herald added a project: LLVM.

This can show up during when bitreverse is expanded to bswap and
swap of bits within a byte. If the input is already a bswap, we
should cancel them out before we further transform them in a way
that makes it harder to see the redundancy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118007

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/test/CodeGen/RISCV/bswap-bitreverse-ctlz-cttz-ctpop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118007.402369.patch
Type: text/x-patch
Size: 12139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220123/c6922dce/attachment.bin>


More information about the llvm-commits mailing list