[CostModel][X86] SK_ExtractSubvector costs must only be tested for vector types (PR39615)

llvm-svn: 346589
This commit is contained in:
Simon Pilgrim 2018-11-10 17:37:52 +00:00
parent 7920baefd7
commit c33f6ba40d

View File

@ -874,7 +874,7 @@ int X86TTIImpl::getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index,
// Subvector extractions are free if they start at beginning of the
// vector.
if (Kind == TTI::SK_ExtractSubvector &&
if (Kind == TTI::SK_ExtractSubvector && LT.second.isVector() &&
((Index % LT.second.getVectorNumElements()) == 0))
return 0;