OSDN Git Service

[CostModel][X86] SK_ExtractSubvector costs must only be tested for vector types ...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 10 Nov 2018 17:37:52 +0000 (17:37 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 10 Nov 2018 17:37:52 +0000 (17:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346589 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetTransformInfo.cpp

index e75653e..960eddc 100644 (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;