aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-04-25 15:22:03 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-04-25 15:22:03 +0000
commit58e03a09dbd9075dd7bad85082207fb19e94ba3f (patch)
tree64f3786a0de58048828bc6002967b2e47c2f11b3
parentef4ece75fdb48b06ab4b8cd087a6fc64b44d5978 (diff)
downloadllvm-58e03a09dbd9075dd7bad85082207fb19e94ba3f.zip
llvm-58e03a09dbd9075dd7bad85082207fb19e94ba3f.tar.gz
llvm-58e03a09dbd9075dd7bad85082207fb19e94ba3f.tar.bz2
[CostModel][X86] Recursive call for cost of imul for packed v16i16 constant shift left.
Don't just assume cost = 1. llvm-svn: 330834
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 4813ab3d..013c2d5 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -492,7 +492,9 @@ int X86TTIImpl::getArithmeticInstrCost(
Op2Info == TargetTransformInfo::OK_NonUniformConstantValue))
// On AVX2, a packed v16i16 shift left by a constant build_vector
// is lowered into a vector multiply (vpmullw).
- return LT.first;
+ return getArithmeticInstrCost(Instruction::Mul, Ty, Op1Info, Op2Info,
+ TargetTransformInfo::OP_None,
+ TargetTransformInfo::OP_None);
if (const auto *Entry = CostTableLookup(AVX2ShiftCostTable, ISD, LT.second))
return LT.first * Entry->Cost;