[SelectionDAG] Don't allow type legalization to create noop VP_TRUNCATE.
authorCraig Topper <craig.topper@sifive.com>
Tue, 13 Jun 2023 19:46:26 +0000 (12:46 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 13 Jun 2023 19:51:24 +0000 (12:51 -0700)
commita5cd198181f937417c988e82f50461adb29aef76
treeeb17667dcd659ba56de1af16af56d16cab538a0b
parentf231829304d15dca0dad8bafe35c4277904db602
[SelectionDAG] Don't allow type legalization to create noop VP_TRUNCATE.

Type legalization may need to promote the result to the same type
as the input. Instead of forming a vp_truncate with the same
source and dest type, don't create any vp_truncate.

Handling in getNode like is done for ISD::TRUNCATE.
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vector-trunc-vp.ll