return ReuseShuffleCost + VecCallCost - ScalarCallCost;
}
case Instruction::ShuffleVector: {
- TargetTransformInfo::OperandValueKind Op1VK =
- TargetTransformInfo::OK_AnyValue;
- TargetTransformInfo::OperandValueKind Op2VK =
- TargetTransformInfo::OK_AnyValue;
int ScalarCost = 0;
if (NeedToShuffleReuses) {
for (unsigned Idx : E->ReuseShuffleIndices) {
Instruction *I = cast<Instruction>(VL[Idx]);
if (!I)
continue;
- ReuseShuffleCost -= TTI->getArithmeticInstrCost(
- I->getOpcode(), ScalarTy, Op1VK, Op2VK);
+ ReuseShuffleCost -=
+ TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy);
}
for (Value *V : VL) {
Instruction *I = cast<Instruction>(V);
if (!I)
continue;
- ReuseShuffleCost += TTI->getArithmeticInstrCost(
- I->getOpcode(), ScalarTy, Op1VK, Op2VK);
+ ReuseShuffleCost +=
+ TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy);
}
}
int VecCost = 0;
Instruction *I = cast<Instruction>(i);
if (!I)
break;
- ScalarCost +=
- TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy, Op1VK, Op2VK);
+ ScalarCost += TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy);
}
// VecCost is equal to sum of the cost of creating 2 vectors
// and the cost of creating shuffle.
Instruction *I0 = cast<Instruction>(VL[0]);
- VecCost =
- TTI->getArithmeticInstrCost(I0->getOpcode(), VecTy, Op1VK, Op2VK);
+ VecCost = TTI->getArithmeticInstrCost(I0->getOpcode(), VecTy);
Instruction *I1 = cast<Instruction>(VL[1]);
- VecCost +=
- TTI->getArithmeticInstrCost(I1->getOpcode(), VecTy, Op1VK, Op2VK);
+ VecCost += TTI->getArithmeticInstrCost(I1->getOpcode(), VecTy);
VecCost += TTI->getShuffleCost(TargetTransformInfo::SK_Select, VecTy, 0);
return ReuseShuffleCost + VecCost - ScalarCost;
}