[all-commits] [llvm/llvm-project] 75cc97: [RISCV] Combine ADDD(lo, hi, x, 0) -> WADDAU(lo, h...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Feb 13 13:40:18 PST 2026


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

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfoP.td
    M llvm/test/CodeGen/RISCV/rv32p.ll

  Log Message:
  -----------
  [RISCV] Combine ADDD(lo, hi, x, 0) -> WADDAU(lo, hi, x, 0). Combine WADDAU (WADDAU lo, hi, x, 0), y, 0 -> WADDAU lo, hi, x, y (#181396)

WADDAU is rd += zext(rs1) + zext(rs2)

If we only have 1 32-bit input can force rs2 to avoid zeroing the upper
part of a register pair to use ADDD.

Unfortunately, WADDAU clobbers rd so it might need a GPRPair copy
if we need the old value of rd. We might need to look into that in
the future. Maybe we could have convertToThreeAddress could turn
it back into ADDD+WADDU or ADDD+LI.

Assisted-by: claude



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