@@ -978,7 +978,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
978978 }
979979}
980980
981- std::optional< InstructionCost> VPRecipeWithIRFlags::getCostForRecipeWithOpcode (
981+ InstructionCost VPRecipeWithIRFlags::getCostForRecipeWithOpcode (
982982 unsigned Opcode, ElementCount VF, VPCostContext &Ctx) const {
983983 Type *ScalarTy = Ctx.Types .inferScalarType (this );
984984 Type *ResultTy = VF.isVector () ? toVectorTy (ScalarTy, VF) : ScalarTy;
@@ -1044,7 +1044,7 @@ std::optional<InstructionCost> VPRecipeWithIRFlags::getCostForRecipeWithOpcode(
10441044 {TTI::OK_AnyValue, TTI::OP_None}, CtxI);
10451045 }
10461046 }
1047- return std:: nullopt ;
1047+ llvm_unreachable ( " called for unsupported opcode " ) ;
10481048}
10491049
10501050InstructionCost VPInstruction::computeCost (ElementCount VF,
@@ -1059,7 +1059,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
10591059 assert (!doesGeneratePerAllLanes () &&
10601060 " Should only generate a vector value or single scalar, not scalars "
10611061 " for all lanes." );
1062- return * getCostForRecipeWithOpcode (
1062+ return getCostForRecipeWithOpcode (
10631063 getOpcode (),
10641064 vputils::onlyFirstLaneUsed (this ) ? ElementCount::getFixed (1 ) : VF, Ctx);
10651065 }
@@ -2206,7 +2206,7 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
22062206 case Instruction::ExtractValue:
22072207 case Instruction::ICmp:
22082208 case Instruction::FCmp:
2209- return * getCostForRecipeWithOpcode (getOpcode (), VF, Ctx);
2209+ return getCostForRecipeWithOpcode (getOpcode (), VF, Ctx);
22102210 default :
22112211 llvm_unreachable (" Unsupported opcode for instruction" );
22122212 }
@@ -3151,15 +3151,15 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
31513151 case Instruction::Xor:
31523152 case Instruction::ICmp:
31533153 case Instruction::FCmp:
3154- return * getCostForRecipeWithOpcode (getOpcode (), ElementCount::getFixed (1 ),
3155- Ctx) *
3154+ return getCostForRecipeWithOpcode (getOpcode (), ElementCount::getFixed (1 ),
3155+ Ctx) *
31563156 (isSingleScalar () ? 1 : VF.getFixedValue ());
31573157 case Instruction::SDiv:
31583158 case Instruction::UDiv:
31593159 case Instruction::SRem:
31603160 case Instruction::URem: {
3161- InstructionCost ScalarCost = * getCostForRecipeWithOpcode (
3162- getOpcode (), ElementCount::getFixed (1 ), Ctx);
3161+ InstructionCost ScalarCost =
3162+ getCostForRecipeWithOpcode ( getOpcode (), ElementCount::getFixed (1 ), Ctx);
31633163 if (isSingleScalar ())
31643164 return ScalarCost;
31653165
0 commit comments