[PATCH] D90170: [InstCombine] InstCombinerImpl::visitOr - enable limited bitreverse matching

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 10:10:14 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: spatel, lebedev.ri, nikic.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
RKSimon requested review of this revision.

Currently we only match bswap intrinsics from or(shl(),lshr()) style patterns when we could often match bitreverse intrinsics almost as cheaply.

I've currently limited this to bitreverse of i16 or less (as a similar bswap limit is i128 or less) - I'm not certain how much we should be trying to do in InstCombine vs AggressiveInstCombine (where I plan to have a similar path with no specific bitwidth limits) - should we bother with matching in InstCombine at all?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90170

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/test/Transforms/InstCombine/bitreverse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90170.300709.patch
Type: text/x-patch
Size: 5627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201026/5e94cccf/attachment.bin>


More information about the llvm-commits mailing list