[all-commits] [llvm/llvm-project] aa68e2: [RISCV] Support `llvm.masked.compressstore` intrin...

Kolya Panchenko via All-commits all-commits at lists.llvm.org
Wed Mar 13 12:19:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aa68e2814d9a4bad21e4def900152b2e78e25e98
      https://github.com/llvm/llvm-project/commit/aa68e2814d9a4bad21e4def900152b2e78e25e98
  Author: Kolya Panchenko <87679760+nikolaypanchenko at users.noreply.github.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
    A llvm/test/CodeGen/RISCV/rvv/compressstore.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-compressstore-fp.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-compressstore-int.ll

  Log Message:
  -----------
  [RISCV] Support `llvm.masked.compressstore` intrinsic (#83457)

The changeset enables lowering of `llvm.masked.compressstore(%data,
%ptr, %mask)` for RVV for fixed vector type into:
```
%0 = vcompress %data, %mask, %vl
%new_vl = vcpop %mask, %vl
vse %0, %ptr, %1, %new_vl
```
Such lowering is only possible when `%data` fits into available LMULs
and otherwise `llvm.masked.compressstore` is scalarized by
`ScalarizeMaskedMemIntrin` pass.
Even though RVV spec in the section `15.8` provide alternative sequence
for compressstore, use of `vcompress + vcpop` should be a proper
canonical form to lower `llvm.masked.compressstore`. If RISC-V target
find the sequence from `15.8` better, peephole optimization can
transform `vcompress + vcpop` into that sequence.



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