From: Cong Hou Date: Wed, 28 Oct 2015 18:15:46 +0000 (+0000) Subject: [X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is simple... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=76481a832623c2a61761a9e78137116c070007cc [X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is simple before calling getSimpleVT(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251538 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86TargetTransformInfo.cpp b/lib/Target/X86/X86TargetTransformInfo.cpp index 8453a51b6d1..5a37f1bfba3 100644 --- a/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/lib/Target/X86/X86TargetTransformInfo.cpp @@ -895,8 +895,9 @@ int X86TTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *SrcTy, // Legalize the type. std::pair LT = TLI->getTypeLegalizationCost(DL, SrcVTy); + auto VT = TLI->getValueType(DL, SrcVTy); int Cost = 0; - if (LT.second != TLI->getValueType(DL, SrcVTy).getSimpleVT() && + 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_Alternate, SrcVTy, 0, nullptr) +