[all-commits] [llvm/llvm-project] 6db0af: [RISCV] Fold (xor (sllw 1, x), -1) -> (rolw ~1, x).

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Apr 19 15:05:05 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6db0afb44e13cf5f3d3261387079b32358966a61
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-04-19 (Tue, 19 Apr 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rv32zbb-zbp-zbkb.ll
    M llvm/test/CodeGen/RISCV/rv64zbb-zbp-zbkb.ll
    M llvm/test/CodeGen/RISCV/sextw-removal.ll

  Log Message:
  [RISCV] Fold (xor (sllw 1, x), -1) -> (rolw ~1, x).

There's an existing generic combine that does this for legal types.
This patch adds a RISCV specific combine for W instructions.

Reviewed By: luismarques

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

More information about the All-commits mailing list