[TTI] Flip vector types in getShuffleCost SK_ExtractSubvector call
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 9 Nov 2018 18:30:59 +0000 (18:30 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 9 Nov 2018 18:30:59 +0000 (18:30 +0000)
For SK_ExtractSubvector, the default 'Ty' type is the source operand type and 'SubTy' is the destination subvector type

I got this the wrong way around when I added rL346510

llvm-svn: 346534

llvm/lib/Analysis/TargetTransformInfo.cpp

index a6a1a872b658d08c7d101a748706944aec65e615..eecc898fb5fd02781ff32c9500a14832fe4546d6 100644 (file)
@@ -1114,7 +1114,7 @@ int TargetTransformInfo::getInstructionThroughput(const Instruction *I) const {
     // TODO: Identify and add costs for insert subvector, etc.
     int SubIndex;
     if (Shuffle->isExtractSubvectorMask(SubIndex))
-      return TTIImpl->getShuffleCost(SK_ExtractSubvector, Ty, SubIndex, SrcTy);
+      return TTIImpl->getShuffleCost(SK_ExtractSubvector, SrcTy, SubIndex, Ty);
 
     if (Shuffle->changesLength())
       return -1;