[all-commits] [llvm/llvm-project] 332318: [SelectionDAG] Widen scalable-vector loads/stores ...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Wed Nov 10 02:04:07 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 332318ffb613907a268aa909552e3eb16bc1af6b
      https://github.com/llvm/llvm-project/commit/332318ffb613907a268aa909552e3eb16bc1af6b
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-11-10 (Wed, 10 Nov 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
    M llvm/test/CodeGen/RISCV/rvv/legalize-load-sdnode.ll
    M llvm/test/CodeGen/RISCV/rvv/legalize-store-sdnode.ll

  Log Message:
  -----------
  [SelectionDAG] Widen scalable-vector loads/stores via VP_LOAD/VP_STORE

This patch fixes a compiler crash when widening scalable-vector loads
and stores which end up breaking down to element-wise store operations.
It does so by providing a way for targets with support for
vector-predicated loads and stores to use those instead. By widening the
operation but maintaining the original effective operation length via
the EVL, only the intended vector elements are loaded or stored.

This method should in theory be possible and even preferred for
fixed-length vector types, but all fixed-length types can be broken down
into their elements, and regardless I have observed regressions in the
generated code when doing so. I believe this is simply due to
VP_LOAD/VP_STORE not being up to par with LOAD/STORE in terms of
optimization. It does improve performance on smaller self-contained
examples, however, so the potential is there.

While the only target that benefits from this is RISCV, the legalization
is generic and so was placed centrally.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D111248




More information about the All-commits mailing list