Skip to content

Commit 68970e0

Browse files
committed
Add assertions
1 parent c30b2ce commit 68970e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,8 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
10111011
case Intrinsic::vp_frem: {
10121012
std::optional<unsigned> FOp =
10131013
VPIntrinsic::getFunctionalOpcodeForVP(ICA.getID());
1014-
if (FOp)
1015-
return getArithmeticInstrCost(*FOp, ICA.getReturnType(), CostKind);
1014+
assert(FOp.has_value());
1015+
return getArithmeticInstrCost(*FOp, ICA.getReturnType(), CostKind);
10161016
break;
10171017
}
10181018
// vp int cast ops.
@@ -1028,9 +1028,9 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
10281028
case Intrinsic::vp_fpext: {
10291029
std::optional<unsigned> FOp =
10301030
VPIntrinsic::getFunctionalOpcodeForVP(ICA.getID());
1031-
if (FOp && !ICA.getArgTypes().empty())
1032-
return getCastInstrCost(*FOp, RetTy, ICA.getArgTypes()[0],
1033-
TTI::CastContextHint::None, CostKind);
1031+
assert(FOp.has_value() && !ICA.getArgTypes().empty());
1032+
return getCastInstrCost(*FOp, RetTy, ICA.getArgTypes()[0],
1033+
TTI::CastContextHint::None, CostKind);
10341034
break;
10351035
}
10361036
}

0 commit comments

Comments
 (0)