diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-04-27 18:47:54 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-04-27 18:47:54 +0000 |
commit | ce4b3fee7274e73cfbdf1e4b3e61dda106dbe2bd (patch) | |
tree | 9fed6f521830060ce7f518a5578d8a01ccbfb740 /llvm/lib/Target | |
parent | 3693e77cb44554f8ae4805dd33eab6a936bf5c35 (diff) | |
download | bcm5719-llvm-ce4b3fee7274e73cfbdf1e4b3e61dda106dbe2bd.tar.gz bcm5719-llvm-ce4b3fee7274e73cfbdf1e4b3e61dda106dbe2bd.zip |
X86TTI: Adjust sdiv cost now that we can lower it on plain SSE2.
Includes a fix for a horrible typo that caused all SDIV costs to be
slightly off :)
llvm-svn: 207371
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index 628e9130a15..1543f109b4c 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -369,11 +369,16 @@ unsigned X86TTI::getArithmeticInstrCost(unsigned Opcode, Type *Ty, { ISD::SDIV, MVT::v8i16, 6 }, // pmulhw sequence { ISD::UDIV, MVT::v8i16, 6 }, // pmulhuw sequence + { ISD::SDIV, MVT::v4i32, 19 }, // pmuludq sequence { ISD::UDIV, MVT::v4i32, 15 }, // pmuludq sequence }; if (Op2Info == TargetTransformInfo::OK_UniformConstantValue && ST->hasSSE2()) { + // pmuldq sequence. + if (ISD == ISD::SDIV && LT.second == MVT::v4i32 && ST->hasSSE41()) + return LT.first * 15; + int Idx = CostTableLookup(SSE2UniformConstCostTable, ISD, LT.second); if (Idx != -1) return LT.first * SSE2UniformConstCostTable[Idx].Cost; |