[PATCH] D121448: [DAGCombine] fold (bitreverse(srl (bitreverse c), x)) -> (shl c, x)

Chenbing.Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 01:00:49 PST 2022


Chenbing.Zheng created this revision.
Chenbing.Zheng added reviewers: craig.topper, frasercrmck, RKSimon, lebedev.ri, benshi001.
Chenbing.Zheng added a project: LLVM.
Herald added subscribers: luke957, ecnelises, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: All.
Chenbing.Zheng requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, jacquesguan, MaskRay.

Combine
t2 = bitreverse t1; t3 = srl t2, x; bitreverse t3 to shl t1, x.

This is similar to D120648 <https://reviews.llvm.org/D120648>,  and there is no limit to x %8 == 0
because of bitreverse is deal with one bit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121448

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/RISCV/bitreverse-srli-bitreverse.ll
  llvm/test/CodeGen/X86/combine-bitreverse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121448.414608.patch
Type: text/x-patch
Size: 6131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220311/f59b6a12/attachment.bin>


More information about the llvm-commits mailing list