[all-commits] [llvm/llvm-project] c74ab8: [RISCV] Ensure small mask BUILD_VECTORs aren't exp...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Thu May 20 11:20:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c74ab891fc9ce4436a3360e14becea9c6794837f
      https://github.com/llvm/llvm-project/commit/c74ab891fc9ce4436a3360e14becea9c6794837f
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-05-20 (Thu, 20 May 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-buildvec.ll

  Log Message:
  -----------
  [RISCV] Ensure small mask BUILD_VECTORs aren't expanded

The default expansion for BUILD_VECTORs -- save for going through
shuffles -- is to go through the stack. This method only works when the
type is at least byte-sized, so for v2i1 and v4i1 we would crash.

This patch ensures that small mask-type BUILD_VECTORs are always handled
without crashing. We lower to a SETCC of the equivalent i8 type.

This also exposes some pre-existing issues where the lowering when
optimizing for size results in larger code than without. Those will be
tackled in future patches.

Reviewed By: craig.topper

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




More information about the All-commits mailing list