[SLP]Try to emit canonical shuffle with undef operand.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 21 Sep 2022 17:19:43 +0000 (10:19 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Tue, 4 Oct 2022 15:16:07 +0000 (08:16 -0700)
commitab9a81f736acfb927b0e0b4f0de8710fc2379f70
tree1a850cd8f9ebd2876af3a0f8c139164f5d170d99
parent75b292cb14141cac086aa595154134d789c5fce7
[SLP]Try to emit canonical shuffle with undef operand.

In the canonical form of the shuffle the poison/undef operand is the
second operand, the patch tries to emit canonical form for partial
vectorization of the buildvector sequence.
Also, this patch starts emitting freeze instruction for shuffles with undef indices if the second shuffle operan is undef, not poison. It is an initial step to D93818, where undef mask element are treated as returning poison value.

Differential Revision: https://reviews.llvm.org/D134377
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/PR35865-inseltpoison.ll
llvm/test/Transforms/SLPVectorizer/X86/PR35865.ll
llvm/test/Transforms/SLPVectorizer/X86/insert-element-build-vector-inseltpoison.ll
llvm/test/Transforms/SLPVectorizer/X86/insert-element-build-vector.ll