[LegalizeTypes] Teach DAGTypeLegalizer::GenWidenVectorLoads to pad with undef if...
authorCraig Topper <craig.topper@intel.com>
Fri, 24 Jul 2020 01:43:40 +0000 (18:43 -0700)
committerCraig Topper <craig.topper@intel.com>
Fri, 24 Jul 2020 02:02:03 +0000 (19:02 -0700)
commit8131e190647ac2b5b085b48a6e3b48c1d7520a66
tree2c9717f3119b9da690595b0b38d48f8953a34d76
parent891759db73f085df6af7bd343aa0cc0b5dccb572
[LegalizeTypes] Teach DAGTypeLegalizer::GenWidenVectorLoads to pad with undef if needed when concatenating small or loads to match a larger load

In the included test case the align 16 allowed the v23f32 load to handled as load v16f32, load v4f32, and load v4f32(one element not used). These loads all need to be concatenated together into a final vector. In this case we tried to concatenate the two v4f32 loads to match the type of the v16f32 load so we could do a second concat_vectors, but those loads alone only add up to v8f32. So we need to two v4f32 undefs to pad it.

It appears we've tried to hack around a similar issue in this code before by adding undef padding to loads in one of the earlier loops in this function. Originally in r147964 by padding all loads narrower than previous loads to the same size. Later modifed to only the last load in r293088. This patch removes that earlier code and just handles it on demand where we know we need it.

Fixes PR46820

Differential Revision: https://reviews.llvm.org/D84463
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/test/CodeGen/X86/pr46820.ll [new file with mode: 0644]