@@ -901,7 +901,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
901901 }
902902}
903903
904- std::optional< InstructionCost> VPRecipeWithIRFlags::getCostForRecipeWithOpcode (
904+ InstructionCost VPRecipeWithIRFlags::getCostForRecipeWithOpcode (
905905 unsigned Opcode, ElementCount VF, VPCostContext &Ctx) const {
906906 Type *ScalarTy = Ctx.Types .inferScalarType (this );
907907 Type *ResultTy = VF.isVector () ? toVectorTy (ScalarTy, VF) : ScalarTy;
@@ -967,7 +967,7 @@ std::optional<InstructionCost> VPRecipeWithIRFlags::getCostForRecipeWithOpcode(
967967 {TTI::OK_AnyValue, TTI::OP_None}, CtxI);
968968 }
969969 }
970- return std:: nullopt ;
970+ llvm_unreachable ( " called for unsupported opcode " ) ;
971971}
972972
973973InstructionCost VPInstruction::computeCost (ElementCount VF,
@@ -982,7 +982,7 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
982982 assert (!doesGeneratePerAllLanes () &&
983983 " Should only generate a vector value or single scalar, not scalars "
984984 " for all lanes." );
985- return * getCostForRecipeWithOpcode (
985+ return getCostForRecipeWithOpcode (
986986 getOpcode (),
987987 vputils::onlyFirstLaneUsed (this ) ? ElementCount::getFixed (1 ) : VF, Ctx);
988988 }
@@ -2064,7 +2064,7 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
20642064 case Instruction::ExtractValue:
20652065 case Instruction::ICmp:
20662066 case Instruction::FCmp:
2067- return * getCostForRecipeWithOpcode (getOpcode (), VF, Ctx);
2067+ return getCostForRecipeWithOpcode (getOpcode (), VF, Ctx);
20682068 default :
20692069 llvm_unreachable (" Unsupported opcode for instruction" );
20702070 }
@@ -3040,16 +3040,16 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
30403040 case Instruction::AShr:
30413041 case Instruction::And:
30423042 case Instruction::Or:
3043- case Instruction::Xor: {
3044- return * getCostForRecipeWithOpcode (getOpcode (), ElementCount::getFixed (1 ),
3045- Ctx) *
3043+ case Instruction::Xor:
3044+ return getCostForRecipeWithOpcode (getOpcode (), ElementCount::getFixed (1 ),
3045+ Ctx) *
30463046 (isSingleScalar () ? 1 : VF.getFixedValue ());
30473047 case Instruction::SDiv:
30483048 case Instruction::UDiv:
30493049 case Instruction::SRem:
30503050 case Instruction::URem: {
3051- InstructionCost ScalarCost = * getCostForRecipeWithOpcode (
3052- getOpcode (), ElementCount::getFixed (1 ), Ctx);
3051+ InstructionCost ScalarCost =
3052+ getCostForRecipeWithOpcode ( getOpcode (), ElementCount::getFixed (1 ), Ctx);
30533053 if (isSingleScalar ())
30543054 return ScalarCost;
30553055
@@ -3076,7 +3076,6 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
30763076 break ;
30773077 }
30783078 }
3079- }
30803079
30813080 return Ctx.getLegacyCost (UI, VF);
30823081}
0 commit comments