diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-05-14 17:59:46 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-05-14 17:59:46 +0000 |
| commit | 5bef9c627e44077e4ec5024be062faecc4eab3e5 (patch) | |
| tree | 68afdca220cfdad89eaf113ceda81b5fc34bf516 /llvm/lib | |
| parent | aa8dffb69bccbe4e41469e0023b7508dd44945f8 (diff) | |
| download | bcm5719-llvm-5bef9c627e44077e4ec5024be062faecc4eab3e5.tar.gz bcm5719-llvm-5bef9c627e44077e4ec5024be062faecc4eab3e5.zip | |
[X86][XOP] XOP's general v16i8 shifts will be used instead of v8i16 shift + mask.
Tweak cost model to match what lowering actually does.
llvm-svn: 303013
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index ba6462a0768..2952925ee41 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -273,9 +273,12 @@ int X86TTIImpl::getArithmeticInstrCost( if (ISD == ISD::SDIV && LT.second == MVT::v4i32 && ST->hasSSE41()) return LT.first * 15; - if (const auto *Entry = CostTableLookup(SSE2UniformConstCostTable, ISD, - LT.second)) - return LT.first * Entry->Cost; + // XOP has faster vXi8 shifts. + if ((ISD != ISD::SHL && ISD != ISD::SRL && ISD != ISD::SRA) || + !ST->hasXOP()) + if (const auto *Entry = + CostTableLookup(SSE2UniformConstCostTable, ISD, LT.second)) + return LT.first * Entry->Cost; } static const CostTblEntry AVX2UniformCostTable[] = { |

