[all-commits] [llvm/llvm-project] 99ef0d: [RISCV] Fold (sub constant, (setcc x, y, eq/neq)) ...

ChunyuLiao via All-commits all-commits at lists.llvm.org
Sat Aug 13 05:38:12 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99ef0ddea3c39aca07c6309b7a5b3cfc4ce1ab19
  Author: LiaoChunyu <chunyu at iscas.ac.cn>
  Date:   2022-08-13 (Sat, 13 Aug 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/setcc-logic.ll

  Log Message:
  [RISCV] Fold (sub constant, (setcc x, y, eq/neq)) -> (add constant - 1, (setcc x, y, neq/eq))

(setcc x, y, eq/neq) are seqz, snez that set rd = 0/1.

addi is used to process immediate, which can save instructions for load immediate.

Reviewed By: craig.topper

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

More information about the All-commits mailing list