[all-commits] [llvm/llvm-project] 63918f: [RISCV] Fold vmerge into op with undef passthru by...

Luke Lau via All-commits all-commits at lists.llvm.org
Thu Feb 5 08:13:35 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 63918f51aa9b0c32d817a8346130e791393b74a6
      https://github.com/llvm/llvm-project/commit/63918f51aa9b0c32d817a8346130e791393b74a6
  Author: Luke Lau <luke at igalia.com>
  Date:   2026-02-06 (Fri, 06 Feb 2026)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-peephole-vmerge-vops.ll
    M llvm/test/CodeGen/RISCV/rvv/vmerge-peephole.mir

  Log Message:
  -----------
  [RISCV] Fold vmerge into op with undef passthru by using vmerge's vl (#179862)

Currently we only fold an op into vmerge if we know the smaller of the
two vls, because we can't increase the vl.

However if the op's passthru is undef, then we can just use vmerge's vl
because the lanes past op's vl were undef anyway. We need to make sure
that the op doesn't access memory though. Other instructions where the
result depends on the VL should already be handled by the
RISCVII::elementsDependOnVL check below.

This is probably always profitable because even though we increase vl,
we remove a vmerge which needs to process vl elements anyway.

This removes some regressions in #179622.



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