[CostModel][X86] Recursive call for cost of imul for packed v16i16 constant shift...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 25 Apr 2018 15:22:03 +0000 (15:22 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 25 Apr 2018 15:22:03 +0000 (15:22 +0000)
Don't just assume cost = 1.

llvm-svn: 330834

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

index 4813ab3..013c2d5 100644 (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;