[CostModel][X86] Recursive call for cost of imul for packed v16i16 constant shift left.

Don't just assume cost = 1.

llvm-svn: 330834
This commit is contained in:
Simon Pilgrim 2018-04-25 15:22:03 +00:00
parent ef4ece75fd
commit 58e03a09db
1 changed files with 3 additions and 1 deletions

View File

@ -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;