[PATCH] D151246: [InstCombine] Improve bitreverse optimization

Austin Chang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 13:00:47 PDT 2023


austin880625 created this revision.
austin880625 added reviewers: goldstein.w.n, RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: All.
austin880625 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch utilizes the helper function implemented in D149699 <https://reviews.llvm.org/D149699> and thus folds the following cases:

  bitreverse(logic_op(x, bitreverse(y))) -> logic_op(bitreverse(x), y)
  bitreverse(logic_op(bitreverse(x), y)) -> logic_op(x, bitreverse(y))
  bitreverse(logic_op(bitreverse(x), bitreverse(y))) -> logic_op(x, y) in multiuse case


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151246

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151246.524852.patch
Type: text/x-patch
Size: 6526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230523/33731654/attachment.bin>


More information about the llvm-commits mailing list