[all-commits] [llvm/llvm-project] 3caa42: [RISCV] Use ComplexPattern to reduce the number of...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Feb 24 09:37:54 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3caa427f8ecbf9f5845c15b53e1021db94b3db03
      https://github.com/llvm/llvm-project/commit/3caa427f8ecbf9f5845c15b53e1021db94b3db03
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
    M llvm/lib/Target/RISCV/RISCVInstrInfo.td
    M llvm/lib/Target/RISCV/RISCVInstrInfoXVentana.td

  Log Message:
  -----------
  [RISCV] Use ComplexPattern to reduce the number of patterns for XVentanaCondOps.

XVentanaCondOps check the condition operand for zero or non-zero.
We use this to optimize seteq/setne that would otherwise becomes
xor/xori/addi+snez/seqz. These patterns avoid the snez/seqz.

This patch adds two ComplexPatterns to match the varous cases and
emit the xor/xori/addi instruction.

These patterns can also be used by D144681.

Reviewed By: philipp.tomsich

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




More information about the All-commits mailing list