From: Simon Pilgrim Date: Sun, 7 Apr 2019 13:26:09 +0000 (+0000) Subject: [CostModel][X86] Masked load legalization requires an binary-shuffle not a select... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e1be17323820fe8f269d9e1ee655705d74d539b;p=llvm [CostModel][X86] Masked load legalization requires an binary-shuffle not a select (PR39812) Expansion/truncation is better described by SK_PermuteTwoSrc than SK_Select git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357864 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86TargetTransformInfo.cpp b/lib/Target/X86/X86TargetTransformInfo.cpp index 134915128d2..ca32ae093cd 100644 --- a/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/lib/Target/X86/X86TargetTransformInfo.cpp @@ -2379,8 +2379,8 @@ int X86TTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *SrcTy, if (VT.isSimple() && LT.second != VT.getSimpleVT() && LT.second.getVectorNumElements() == NumElem) // Promotion requires expand/truncate for data and a shuffle for mask. - Cost += getShuffleCost(TTI::SK_Select, SrcVTy, 0, nullptr) + - getShuffleCost(TTI::SK_Select, MaskTy, 0, nullptr); + Cost += getShuffleCost(TTI::SK_PermuteTwoSrc, SrcVTy, 0, nullptr) + + getShuffleCost(TTI::SK_PermuteTwoSrc, MaskTy, 0, nullptr); else if (LT.second.getVectorNumElements() > NumElem) { VectorType *NewMaskTy = VectorType::get(MaskTy->getVectorElementType(),