@@ -978,7 +978,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
978
978
}
979
979
}
980
980
981
- std::optional< InstructionCost> VPRecipeWithIRFlags::getCostForRecipeWithOpcode (
981
+ InstructionCost VPRecipeWithIRFlags::getCostForRecipeWithOpcode (
982
982
unsigned Opcode, ElementCount VF, VPCostContext &Ctx) const {
983
983
Type *ScalarTy = Ctx.Types .inferScalarType (this );
984
984
Type *ResultTy = VF.isVector () ? toVectorTy (ScalarTy, VF) : ScalarTy;
@@ -1044,7 +1044,7 @@ std::optional<InstructionCost> VPRecipeWithIRFlags::getCostForRecipeWithOpcode(
1044
1044
{TTI::OK_AnyValue, TTI::OP_None}, CtxI);
1045
1045
}
1046
1046
}
1047
- return std:: nullopt ;
1047
+ llvm_unreachable ( " called for unsupported opcode " ) ;
1048
1048
}
1049
1049
1050
1050
InstructionCost VPInstruction::computeCost (ElementCount VF,
@@ -1059,7 +1059,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
1059
1059
assert (!doesGeneratePerAllLanes () &&
1060
1060
" Should only generate a vector value or single scalar, not scalars "
1061
1061
" for all lanes." );
1062
- return * getCostForRecipeWithOpcode (
1062
+ return getCostForRecipeWithOpcode (
1063
1063
getOpcode (),
1064
1064
vputils::onlyFirstLaneUsed (this ) ? ElementCount::getFixed (1 ) : VF, Ctx);
1065
1065
}
@@ -2206,7 +2206,7 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
2206
2206
case Instruction::ExtractValue:
2207
2207
case Instruction::ICmp:
2208
2208
case Instruction::FCmp:
2209
- return * getCostForRecipeWithOpcode (getOpcode (), VF, Ctx);
2209
+ return getCostForRecipeWithOpcode (getOpcode (), VF, Ctx);
2210
2210
default :
2211
2211
llvm_unreachable (" Unsupported opcode for instruction" );
2212
2212
}
@@ -3151,15 +3151,15 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
3151
3151
case Instruction::Xor:
3152
3152
case Instruction::ICmp:
3153
3153
case Instruction::FCmp:
3154
- return * getCostForRecipeWithOpcode (getOpcode (), ElementCount::getFixed (1 ),
3155
- Ctx) *
3154
+ return getCostForRecipeWithOpcode (getOpcode (), ElementCount::getFixed (1 ),
3155
+ Ctx) *
3156
3156
(isSingleScalar () ? 1 : VF.getFixedValue ());
3157
3157
case Instruction::SDiv:
3158
3158
case Instruction::UDiv:
3159
3159
case Instruction::SRem:
3160
3160
case Instruction::URem: {
3161
- InstructionCost ScalarCost = * getCostForRecipeWithOpcode (
3162
- getOpcode (), ElementCount::getFixed (1 ), Ctx);
3161
+ InstructionCost ScalarCost =
3162
+ getCostForRecipeWithOpcode ( getOpcode (), ElementCount::getFixed (1 ), Ctx);
3163
3163
if (isSingleScalar ())
3164
3164
return ScalarCost;
3165
3165
0 commit comments