[PATCH] D120648: [RISCV] DAGcombine fold (bswap(srl (bswap c), x)) -> (shl c, x)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 10:41:36 PST 2022


craig.topper added a comment.

In D120648#3349296 <https://reviews.llvm.org/D120648#3349296>, @RKSimon wrote:

> TBH, this pattern is probably more likely to occur in general code than anything with a bitreverse

Fair enough, but in that case we need a different set of test cases. All of the examples here could legally be a single brev8(reverse bits within each byte) instruction. The shifts are artifacts of type legalization and shouldn't be there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120648



More information about the llvm-commits mailing list