[all-commits] [llvm/llvm-project] af3a83: [RISCV] Add support for bitcasts between scalars a...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Mon Apr 5 09:29:02 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af3a839c70adb97323fa3d122e9ab44522dca74e
      https://github.com/llvm/llvm-project/commit/af3a839c70adb97323fa3d122e9ab44522dca74e
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-04-05 (Mon, 05 Apr 2021)

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

  Log Message:
  -----------
  [RISCV] Add support for bitcasts between scalars and fixed-length vectors

This patch supports bitcasts from scalar types to fixed-length vectors
and vice versa. It custom-lowers and custom-legalizes them to
EXTRACT_VECTOR_ELT/INSERT_VECTOR_ELT operations, using a single-element
vectors to hold the scalar where appropriate.

Previously, some of these would fail to select, others would be expanded
through stack loads and stores. Effort was made to ensure the codegen
avoids the stack for both legal and illegal scalar types.

Some of the codegen could be improved, but on first glance it looks like
a general optimization of EXTRACT_VECTOR_ELT when extracting an i64
element on RV32.

Reviewed By: craig.topper

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




More information about the All-commits mailing list