[all-commits] [llvm/llvm-project] 2319a1: [RISCV] Select (add x, C) -> (sub x, -C) if -C che...

Piotr Fusik via All-commits all-commits at lists.llvm.org
Mon Apr 28 01:14:34 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2319a1eb8112ee7d2f5338f7d2fadd0a893a3cb6
      https://github.com/llvm/llvm-project/commit/2319a1eb8112ee7d2f5338f7d2fadd0a893a3cb6
  Author: Piotr Fusik <p.fusik at samsung.com>
  Date:   2025-04-28 (Mon, 28 Apr 2025)

  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/test/CodeGen/RISCV/add-imm64-to-sub.ll

  Log Message:
  -----------
  [RISCV] Select (add x, C) -> (sub x, -C) if -C cheaper to materialize (#137309)

RV64 only. For 32-bit constants, a negated constant is never cheaper.

This change is similar to how #120221 selects inverted bitwise instructions.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list