[SLP]Fix a crash when preparing a mask for external scalars.
authorAlexey Bataev <a.bataev@outlook.com>
Mon, 9 May 2022 14:31:33 +0000 (07:31 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 9 May 2022 14:59:34 +0000 (07:59 -0700)
commit9c3a75eabf577f0e0e372be95ec4861600a5acdb
treeb2cdcae38b494e5505e60b6441d69a78e50ae9e7
parent68e1ba818869d6312a2774ccc320c0de86a8249c
[SLP]Fix a crash when preparing a mask for external scalars.

Need to use actual index instead of the tree entry position, since the
insert index may be different than 0. It mean, that we vectorized part
of the buildvector starting from not initial insertelement instruction
beause of some reason.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle.ll [new file with mode: 0644]