OSDN Git Service

[RISCV] Add scalable vector truncate patterns
authorFraser Cormack <fraser@codeplay.com>
Fri, 15 Jan 2021 17:04:52 +0000 (17:04 +0000)
committerFraser Cormack <fraser@codeplay.com>
Mon, 18 Jan 2021 10:18:43 +0000 (10:18 +0000)
commitac603c8d3850ed0c715c421d79bb5cb014bb21de
treec9164c1364269022cc1fd9a85ddb6391a03f3f6f
parent770d1e0a8828010a7c95de4596e24d54ed2527c3
[RISCV] Add scalable vector truncate patterns

Original patch by @rogfer01.

This patch supports vector truncates, which on RVV must be done in a
series of instructions truncating by one power-of-two at a time. This is
done through custom-lowering and a custom node to avoid LLVM
re-combining the split TRUNCATE nodes.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Fraser Cormack <fraser@codeplay.com>
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D94796
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
llvm/test/CodeGen/RISCV/rvv/vtruncs-sdnode-rv32.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vtruncs-sdnode-rv64.ll [new file with mode: 0644]