[all-commits] [llvm/llvm-project] 7851b8: [RISCV] Combine vslide{up, down} x, poison -> x (#1...

Luke Lau via All-commits all-commits at lists.llvm.org
Sun Nov 23 19:54:57 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7851b8a65c5481bdf4a56f61a2c9603c2880dbc2
      https://github.com/llvm/llvm-project/commit/7851b8a65c5481bdf4a56f61a2c9603c2880dbc2
  Author: Luke Lau <luke at igalia.com>
  Date:   2025-11-24 (Mon, 24 Nov 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    A llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vector-splice.ll
    M llvm/test/CodeGen/RISCV/rvv/vector-splice.ll

  Log Message:
  -----------
  [RISCV] Combine vslide{up,down} x, poison -> x (#169013)

The motivation for this is that it would be useful to express a
vslideup/vslidedown in a target independent way e.g. from the loop
vectorizer.

We can do this today with @llvm.vector.splice by setting one operand to
poison:

- A slide down can be achieved with @llvm.vector.splice(%x, poison,
slideamt)
- A slide up can be done by @llvm.vector.splice(poison, %x, -slideamt)

E.g.:

    splice(<a,b,c,d>, poison, 3) = <d,poison,poison,poison>
    splice(poison, <a,b,c,d>, -3) = <poison,poison,poison,a>

These splices get lowered to a vslideup + vslidedown pair with one of
the vs2s being poison. We can optimize this away so that we are just
left with a single slideup/slidedown.



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