[SLP]Fix PR52090: clang crashes: Assertion `Index < Length && "Invalid index!"' failed.
authorAlexey Bataev <a.bataev@outlook.com>
Thu, 14 Oct 2021 13:40:06 +0000 (06:40 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Thu, 14 Oct 2021 21:26:29 +0000 (14:26 -0700)
commit414abff1fe8ac3d5874f9b838cb59a3300b3e475
treee1d65004e781b9c22dc02083afb86d3bf9de724b
parent277623f4d5a672d707390e2c3eaf30a9eb4b075c
[SLP]Fix PR52090: clang crashes: Assertion `Index < Length && "Invalid index!"' failed.

Need to check that either Idx is UndefMaskElem and value is UndefValue
or Idx is valid and value is the same as the scalar value in the node.

Differential Revision: https://reviews.llvm.org/D111802
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/crash_undef_mask_elem.ll [new file with mode: 0644]