[DAG] Don't convert undef to 0 when creating buildvector
authorDavid Green <david.green@arm.com>
Sun, 6 Mar 2022 18:35:34 +0000 (18:35 +0000)
committerDavid Green <david.green@arm.com>
Sun, 6 Mar 2022 18:35:34 +0000 (18:35 +0000)
commit4388f4f77694579b088e302204ecfa5588486f06
treee0d03769a3b3df31027747b70857e6bc5f8fb1ea
parent924eac4942408fc0cd5490af76a6d23011a542d1
[DAG] Don't convert undef to 0 when creating buildvector

When inserting undef into buildvectors created from shuffles of
buildvectors, we convert elements to the largest needed type. This had
the effect of converting undef into 0, which isn't needed as the
buildvector implicitly truncates and trunc(zext(undef)) == undef.

Differential Revision: https://reviews.llvm.org/D121002
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/arm64-vshuffle.ll
llvm/test/CodeGen/PowerPC/vec-itofp.ll
llvm/test/CodeGen/PowerPC/vec_conv_i16_to_fp64_elts.ll
llvm/test/CodeGen/PowerPC/vec_conv_i8_to_fp32_elts.ll
llvm/test/CodeGen/PowerPC/vec_conv_i8_to_fp64_elts.ll
llvm/test/CodeGen/Thumb2/mve-vst3.ll