diff options
author | Cong Hou <congh@google.com> | 2015-10-28 18:15:46 +0000 |
---|---|---|
committer | Cong Hou <congh@google.com> | 2015-10-28 18:15:46 +0000 |
commit | da4e8aeec68136c86896cbd3e61a8ef5704d304b (patch) | |
tree | 9d7990a950e453a82dfb7070d556451439518152 /llvm/lib/Target/X86/X86TargetTransformInfo.cpp | |
parent | b704b69e0bf6db0d0369ee84f7437d231a3fcfe9 (diff) | |
download | bcm5719-llvm-da4e8aeec68136c86896cbd3e61a8ef5704d304b.tar.gz bcm5719-llvm-da4e8aeec68136c86896cbd3e61a8ef5704d304b.zip |
[X86] A small fix in X86/X86TargetTransformInfo.cpp: check a value type is simple before calling getSimpleVT().
llvm-svn: 251538
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index 8453a51b6d1..5a37f1bfba3 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -895,8 +895,9 @@ int X86TTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *SrcTy, // Legalize the type. std::pair<int, MVT> 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) + |