[all-commits] [llvm/llvm-project] ef78f2: [LegalizeTypes][VP] Add splitting support for bina...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Thu Sep 2 02:26:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ef78f2106cd7d5bf9afeaaf030dc4e0d241f7ea3
      https://github.com/llvm/llvm-project/commit/ef78f2106cd7d5bf9afeaaf030dc4e0d241f7ea3
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-09-02 (Thu, 02 Sep 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vadd-vp.ll
    M llvm/test/CodeGen/RISCV/rvv/vadd-vp.ll

  Log Message:
  -----------
  [LegalizeTypes][VP] Add splitting support for binary VP ops

This patch extends D107904's introduction of vector-predicated (VP)
operation legalization to include vector splitting.

When the result of a binary VP operation needs splitting, all of its
operands are split in kind. The two operands and the mask are split as
usual, and the vector-length parameter EVL is "split" such that the low
and high halves each execute the correct number of elements.

Tests have been added to the RISC-V target to show splitting several
scenarios for fixed- and scalable-vector types. Without support for
`umax` (e.g. in the `B` extension) the generated code starts to branch.
Ideally a cost model would prevent their insertion in the first place.

Through these tests many opportunities for better codegen can be seen:
combining known-undef VP operations and for constant-folding operations
on `ISD::VSCALE`, to name but a few.

Reviewed By: RKSimon

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




More information about the All-commits mailing list