diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-06-11 19:23:02 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-06-11 19:23:02 +0000 |
commit | 3fc09f7be672dd1adf4e0d939aa86badcdfd5df8 (patch) | |
tree | 202f9f773a25ba5152a9b484cea9e980a201dff1 /llvm/lib/Target/X86/X86TargetTransformInfo.cpp | |
parent | 3717aa5ddbf9bd5b14f9604b5bd0803dc7e8fe8a (diff) | |
download | bcm5719-llvm-3fc09f7be672dd1adf4e0d939aa86badcdfd5df8.tar.gz bcm5719-llvm-3fc09f7be672dd1adf4e0d939aa86badcdfd5df8.zip |
[CostModel][X86][SSE] Updated costs for vector BITREVERSE ops on SSSE3+ targets
To account for the fast PSHUFB implementation now available
llvm-svn: 272484
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index c86790a9326..b5de8f947c9 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -947,6 +947,24 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy, { ISD::BITREVERSE, MVT::i16, 3 }, { ISD::BITREVERSE, MVT::i8, 3 } }; + static const CostTblEntry AVX2CostTbl[] = { + { ISD::BITREVERSE, MVT::v4i64, 5 }, + { ISD::BITREVERSE, MVT::v8i32, 5 }, + { ISD::BITREVERSE, MVT::v16i16, 5 }, + { ISD::BITREVERSE, MVT::v32i8, 5 } + }; + static const CostTblEntry AVX1CostTbl[] = { + { ISD::BITREVERSE, MVT::v4i64, 10 }, + { ISD::BITREVERSE, MVT::v8i32, 10 }, + { ISD::BITREVERSE, MVT::v16i16, 10 }, + { ISD::BITREVERSE, MVT::v32i8, 10 } + }; + static const CostTblEntry SSSE3CostTbl[] = { + { ISD::BITREVERSE, MVT::v2i64, 5 }, + { ISD::BITREVERSE, MVT::v4i32, 5 }, + { ISD::BITREVERSE, MVT::v8i16, 5 }, + { ISD::BITREVERSE, MVT::v16i8, 5 } + }; unsigned ISD = ISD::DELETED_NODE; switch (IID) { @@ -966,6 +984,18 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy, if (const auto *Entry = CostTableLookup(XOPCostTbl, ISD, MTy)) return LT.first * Entry->Cost; + if (ST->hasAVX2()) + if (const auto *Entry = CostTableLookup(AVX2CostTbl, ISD, MTy)) + return LT.first * Entry->Cost; + + if (ST->hasAVX()) + if (const auto *Entry = CostTableLookup(AVX1CostTbl, ISD, MTy)) + return LT.first * Entry->Cost; + + if (ST->hasSSSE3()) + if (const auto *Entry = CostTableLookup(SSSE3CostTbl, ISD, MTy)) + return LT.first * Entry->Cost; + return BaseT::getIntrinsicInstrCost(IID, RetTy, Tys, FMF); } |