diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-10-27 15:27:00 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-10-27 15:27:00 +0000 |
commit | 820e1326d726f8219b0de369f8dc14c666197c17 (patch) | |
tree | 726505c42b9e22c99ffe2bd44eef3796a7ac61ec /llvm/lib/Target/X86/X86TargetTransformInfo.cpp | |
parent | e372aecb8ac914133c960bd8ea5c52c5fdebe81d (diff) | |
download | bcm5719-llvm-820e1326d726f8219b0de369f8dc14c666197c17.tar.gz bcm5719-llvm-820e1326d726f8219b0de369f8dc14c666197c17.zip |
[X86][AVX512DQ] Improve lowering of MUL v2i64 and v4i64
With DQI but without VLX, lower v2i64 and v4i64 MUL operations with v8i64 MUL (vpmullq).
Updated cost table accordingly.
Differential Revision: https://reviews.llvm.org/D26011
llvm-svn: 285304
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index a2cc73addf4..f8d3a04c367 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -204,6 +204,19 @@ int X86TTIImpl::getArithmeticInstrCost( return LT.first * Entry->Cost; } + static const CostTblEntry AVX512DQCostTable[] = { + { ISD::MUL, MVT::v2i64, 1 }, + { ISD::MUL, MVT::v4i64, 1 }, + { ISD::MUL, MVT::v8i64, 1 } + }; + + // Look for AVX512DQ lowering tricks for custom cases. + if (ST->hasDQI()) { + if (const auto *Entry = CostTableLookup(AVX512DQCostTable, ISD, + LT.second)) + return LT.first * Entry->Cost; + } + static const CostTblEntry AVX512BWCostTable[] = { // Vectorizing division is a bad idea. See the SSE2 table for more comments. { ISD::SDIV, MVT::v64i8, 64*20 }, |