[all-commits] [llvm/llvm-project] b8c7cd: [SelectionDAG][RISCV] Teach getNode to fold bswap(...

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


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

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

  Log Message:
  -----------
  [SelectionDAG][RISCV] Teach getNode to fold bswap(bswap(x))->x.

This can show up during when bitreverse is expanded to bswap and
swap of bits within a byte. If the input is already a bswap, we
should cancel them out before we further transform them in a way
that makes it harder to see the redundancy.

Reviewed By: RKSimon

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




More information about the All-commits mailing list