[all-commits] [llvm/llvm-project] 8d69e9: [RISCV] Add combine for shadd family of instructio...

Stefan Pintilie via All-commits all-commits at lists.llvm.org
Mon Mar 31 07:02:35 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8d69e953b5a894c215b0cff7c6b0687b2b492318
      https://github.com/llvm/llvm-project/commit/8d69e953b5a894c215b0cff7c6b0687b2b492318
  Author: Stefan Pintilie <pintilie at synopsys.com>
  Date:   2025-03-31 (Mon, 31 Mar 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    A llvm/test/CodeGen/RISCV/reassoc-shl-addi-add.ll

  Log Message:
  -----------
  [RISCV] Add combine for shadd family of instructions. (#130829)

For example for the following situation:
  %6:gpr = SLLI %2:gpr, 2
  %7:gpr = ADDI killed %6:gpr, 24
  %8:gpr = ADD %0:gpr, %7:gpr

If we swap the two add instrucions we can merge the shift and add. The
final code will look something like this:
  %7 = SH2ADD %0, %2
  %8 = ADDI %7, 24



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