[all-commits] [llvm/llvm-project] b45a26: [RISCV] Enable fixed length vectors and loop vecto...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Aug 26 14:45:44 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b45a262679abce64850cb373674cfaedc2a2949f
      https://github.com/llvm/llvm-project/commit/b45a262679abce64850cb373674cfaedc2a2949f
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVSubtarget.cpp
    M llvm/test/Analysis/CostModel/RISCV/active_lane_mask.ll
    M llvm/test/CodeGen/RISCV/fold-vector-cmp.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/illegal-type.ll

  Log Message:
  -----------
  [RISCV] Enable fixed length vectors and loop vectorization with same

This change enables the use of RISCV's variable length vector registers for fixed length vectors in the IR, and implicitly enables various IR transforms which generate fixed length vectors if legal (e.g. LoopVectorize). Specifically, this enables fixed length vectors which are known to be inbounds of the underlying variable hardware size.

For context, remember that the +V extension provides a minimum VLEN of 128. The embedded variants provide lower minimums. The analogy here is essentially vectorizing for SSE on a machine which may or may not include AVX2/AVX512. We won't get full utilization by default, but we will get some benefit. And of course, with an explicit mcpu we can vectorize to the exact target hardware.

The LV impact is mostly related to vectorizer robustness. In cases we haven't yet fully implemented scalable vectorization support, we can fall back to fixed length vectorization.

SLP has been disabled for now, even when fixed vectors are enabled.  See a310637 and associated review.  There are a few addiitional code quality issues which need worked through before turning SLP on would be reasonable.

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




More information about the All-commits mailing list