[SLP]Fix compiler crash when calculating extract cost for undefs.
authorAlexey Bataev <a.bataev@outlook.com>
Mon, 6 Dec 2021 16:32:15 +0000 (08:32 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 6 Dec 2021 18:46:13 +0000 (10:46 -0800)
commita101a9b64b31ed20e4d18c2e395b0a3742ad1836
tree722a7d56e1cb03afb464b0320c0da6421eb2a377
parent5871969048e4bb62efc97f25a8038604501ecead
[SLP]Fix compiler crash when calculating extract cost for undefs.

Need to add an extra check for potential undef values in
computeExtractCost function to avoid compiler crash on casting to
instructon.

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