[all-commits] [llvm/llvm-project] a43ed4: [DAGCombiner][RISCV] Canonicalize (bswap(bitrevers...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Jan 24 08:32:32 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a43ed49f5b163b2926641729a30a5c17c2116a08
      https://github.com/llvm/llvm-project/commit/a43ed49f5b163b2926641729a30a5c17c2116a08
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-01-24 (Mon, 24 Jan 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/RISCV/bswap-bitreverse-ctlz-cttz-ctpop.ll
    M llvm/test/CodeGen/RISCV/rv32zbp.ll
    M llvm/test/CodeGen/RISCV/rv64zbp.ll

  Log Message:
  -----------
  [DAGCombiner][RISCV] Canonicalize (bswap(bitreverse(x))->bitreverse(bswap(x)).

If the bitreverse gets expanded, it will introduce a new bswap. By
putting a bswap before the bitreverse, we can ensure it gets cancelled
out when this happens.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D118012




More information about the All-commits mailing list