From d3ca710ec9a89d66a9ce9fef80f8df12988d4e84 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 10 Nov 2018 17:37:52 +0000 Subject: [PATCH] [CostModel][X86] SK_ExtractSubvector costs must only be tested for vector types (PR39615) llvm-svn: 346589 --- llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index e75653e12dd8..960eddca9257 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -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;