[RISCV] Legalize fixed length (insert_subvector undef, X, 0) to a scalable insert.
authorCraig Topper <craig.topper@sifive.com>
Mon, 17 Jan 2022 22:31:28 +0000 (14:31 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 17 Jan 2022 22:31:30 +0000 (14:31 -0800)
commit9c410838d2bcaa087e867e9f8a353fe455588287
tree9bf6812b5f6707a99a35f00492c5c4a778cc96b8
parent4869a22d1d0bff59e3f2699739554d459905a76d
[RISCV] Legalize fixed length (insert_subvector undef, X, 0) to a scalable insert.

We were considering this legal, but later the undef would become an all
zeros vector. This would cause us to need to re-legalize the insert later
into a vslideup with zero vector.

This patch catches the case and directly legalizes it to a scalable
insert.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D117377
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-extload-truncstore.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-conv.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp2i.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-i2fp.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert-subvector.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-exttrunc.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-gather.ll