Skip to content

Commit 00f0604

Browse files
committed
[CostModel] Remove optional from InstructionCost::getValue()
InstructionCost is already an optional value, containing an Invalid state that can be checked with isValid(). There is little point in returning another optional from getValue(). Most uses do not make use of it being a std::optional, dereferencing the value directly (either isValid has been checked previously or the Cost is assumed to be valid). The one case that does in AMDGPU used value_or which has been replaced by a new getValueOr(CostType) function.
1 parent 81499ed commit 00f0604

22 files changed

+52
-51
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
16111611

16121612
// Scale the cost of the load by the fraction of legal instructions that
16131613
// will be used.
1614-
Cost = divideCeil(UsedInsts.count() * *Cost.getValue(), NumLegalInsts);
1614+
Cost = divideCeil(UsedInsts.count() * Cost.getValue(), NumLegalInsts);
16151615
}
16161616

16171617
// Then plus the cost of interleave operation.
@@ -2879,7 +2879,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
28792879
SubTp && SubTp->getElementType() == FTp->getElementType())
28802880
return divideCeil(FTp->getNumElements(), SubTp->getNumElements());
28812881
}
2882-
return *LT.first.getValue();
2882+
return LT.first.getValue();
28832883
}
28842884

28852885
InstructionCost getAddressComputationCost(Type *Ty, ScalarEvolution *,

llvm/include/llvm/Support/InstructionCost.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include "llvm/Support/MathExtras.h"
2222
#include <limits>
23-
#include <optional>
2423

2524
namespace llvm {
2625

@@ -84,10 +83,14 @@ class InstructionCost {
8483
/// This function is intended to be used as sparingly as possible, since the
8584
/// class provides the full range of operator support required for arithmetic
8685
/// and comparisons.
87-
std::optional<CostType> getValue() const {
88-
if (isValid())
89-
return Value;
90-
return std::nullopt;
86+
CostType getValue() const {
87+
assert(isValid());
88+
return Value;
89+
}
90+
CostType getValueOr(CostType Alt) const {
91+
if (!isValid())
92+
return Alt;
93+
return Value;
9194
}
9295

9396
/// For all of the arithmetic operators provided here any invalid state is

llvm/include/llvm/Transforms/Utils/UnrollLoop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class UnrollCostEstimator {
143143
/// Whether it is legal to unroll this loop.
144144
bool canUnroll() const;
145145

146-
uint64_t getRolledLoopSize() const { return *LoopSize.getValue(); }
146+
uint64_t getRolledLoopSize() const { return LoopSize.getValue(); }
147147

148148
/// Returns loop size estimation for unrolled loop, given the unrolling
149149
/// configuration specified by UP.

llvm/lib/Analysis/CostModel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ PreservedAnalyses CostModelPrinterPass::run(Function &F,
128128
} else {
129129
InstructionCost Cost =
130130
getCost(Inst, OutputCostKindToTargetCostKind(CostKind), TTI, TLI);
131-
if (auto CostVal = Cost.getValue())
132-
OS << "Found an estimated cost of " << *CostVal;
131+
if (Cost.isValid())
132+
OS << "Found an estimated cost of " << Cost.getValue();
133133
else
134134
OS << "Invalid cost";
135135
OS << " for instruction: " << Inst << "\n";

llvm/lib/CodeGen/SelectOptimize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class SelectOptimizeImpl {
206206
getI()->getOpcode(), I->getType(), TargetTransformInfo::TCK_Latency,
207207
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None},
208208
{TTI::OK_UniformConstantValue, TTI::OP_PowerOf2});
209-
auto TotalCost = Scaled64::get(*Cost.getValue());
209+
auto TotalCost = Scaled64::get(Cost.getValue());
210210
if (auto *OpI = dyn_cast<Instruction>(I->getOperand(1 - CondIdx))) {
211211
auto It = InstCostMap.find(OpI);
212212
if (It != InstCostMap.end())
@@ -1380,8 +1380,8 @@ std::optional<uint64_t>
13801380
SelectOptimizeImpl::computeInstCost(const Instruction *I) {
13811381
InstructionCost ICost =
13821382
TTI->getInstructionCost(I, TargetTransformInfo::TCK_Latency);
1383-
if (auto OC = ICost.getValue())
1384-
return std::optional<uint64_t>(*OC);
1383+
if (ICost.isValid())
1384+
return std::optional<uint64_t>(ICost.getValue());
13851385
return std::nullopt;
13861386
}
13871387

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28496,7 +28496,7 @@ bool AArch64TargetLowering::shouldLocalize(
2849628496
Imm, CI->getType(), TargetTransformInfo::TCK_CodeSize);
2849728497
assert(Cost.isValid() && "Expected a valid imm cost");
2849828498

28499-
unsigned RematCost = *Cost.getValue();
28499+
unsigned RematCost = Cost.getValue();
2850028500
RematCost += AdditionalCost;
2850128501
Register Reg = MI.getOperand(0).getReg();
2850228502
unsigned MaxUses = maxUses(RematCost);

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4596,7 +4596,7 @@ static bool isLoopSizeWithinBudget(Loop *L, AArch64TTIImpl &TTI,
45964596
}
45974597

45984598
if (FinalSize)
4599-
*FinalSize = *LoopCost.getValue();
4599+
*FinalSize = LoopCost.getValue();
46004600
return true;
46014601
}
46024602

llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ static CostType calculateFunctionCosts(GetTTIFn GetTTI, Module &M,
205205
TTI.getInstructionCost(&I, TargetTransformInfo::TCK_CodeSize);
206206
assert(Cost != InstructionCost::getMax());
207207
// Assume expensive if we can't tell the cost of an instruction.
208-
CostType CostVal =
209-
Cost.getValue().value_or(TargetTransformInfo::TCC_Expensive);
208+
CostType CostVal = Cost.getValueOr(TargetTransformInfo::TCC_Expensive);
210209
assert((FnCost + CostVal) >= FnCost && "Overflow!");
211210
FnCost += CostVal;
212211
}

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,9 @@ static unsigned adjustInliningThresholdUsingCallee(const CallBase *CB,
12781278
// The penalty cost is computed relative to the cost of instructions and does
12791279
// not model any storage costs.
12801280
adjustThreshold += std::max(0, SGPRsInUse - NrOfSGPRUntilSpill) *
1281-
*ArgStackCost.getValue() * InlineConstants::getInstrCost();
1281+
ArgStackCost.getValue() * InlineConstants::getInstrCost();
12821282
adjustThreshold += std::max(0, VGPRsInUse - NrOfVGPRUntilSpill) *
1283-
*ArgStackCost.getValue() * InlineConstants::getInstrCost();
1283+
ArgStackCost.getValue() * InlineConstants::getInstrCost();
12841284
return adjustThreshold;
12851285
}
12861286

llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ InstructionCost PPCTTIImpl::getVPMemoryOpCost(unsigned Opcode, Type *Src,
11001100
float AlignmentProb = ((float)Alignment.value()) / DesiredAlignment.value();
11011101
float MisalignmentProb = 1.0 - AlignmentProb;
11021102
return (MisalignmentProb * P9PipelineFlushEstimate) +
1103-
(AlignmentProb * *Cost.getValue());
1103+
(AlignmentProb * Cost.getValue());
11041104
}
11051105

11061106
// Usually we should not get to this point, but the following is an attempt to

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2900,7 +2900,7 @@ InstructionCost RISCVTargetLowering::getVRGatherVVCost(MVT VT) const {
29002900
bool Log2CostModel =
29012901
Subtarget.getVRGatherCostModel() == llvm::RISCVSubtarget::NLog2N;
29022902
if (Log2CostModel && LMULCost.isValid()) {
2903-
unsigned Log = Log2_64(*LMULCost.getValue());
2903+
unsigned Log = Log2_64(LMULCost.getValue());
29042904
if (Log > 0)
29052905
return LMULCost * Log;
29062906
}

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ costShuffleViaVRegSplitting(RISCVTTIImpl &TTI, MVT LegalVT,
425425
auto *SingleOpTy = FixedVectorType::get(Tp->getElementType(),
426426
LegalVT.getVectorNumElements());
427427

428-
unsigned E = *NumOfDests.getValue();
428+
unsigned E = NumOfDests.getValue();
429429
unsigned NormalizedVF =
430430
LegalVT.getVectorNumElements() * std::max(NumOfSrcs, E);
431431
unsigned NumOfSrcRegs = NormalizedVF / LegalVT.getVectorNumElements();
@@ -651,13 +651,12 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
651651
if (!Mask.empty() && LT.first.isValid() && LT.first != 1 &&
652652
shouldSplit(Kind) &&
653653
LT.second.getVectorElementType().getSizeInBits() ==
654-
Tp->getElementType()->getPrimitiveSizeInBits() &&
654+
Tp->getElementType()->getPrimitiveSizeInBits() &&
655655
LT.second.getVectorNumElements() <
656-
cast<FixedVectorType>(Tp)->getNumElements() &&
657-
divideCeil(Mask.size(),
658-
cast<FixedVectorType>(Tp)->getNumElements()) ==
659-
static_cast<unsigned>(*LT.first.getValue())) {
660-
unsigned NumRegs = *LT.first.getValue();
656+
cast<FixedVectorType>(Tp)->getNumElements() &&
657+
divideCeil(Mask.size(), cast<FixedVectorType>(Tp)->getNumElements()) ==
658+
static_cast<unsigned>(LT.first.getValue())) {
659+
unsigned NumRegs = LT.first.getValue();
661660
unsigned VF = cast<FixedVectorType>(Tp)->getNumElements();
662661
unsigned SubVF = PowerOf2Ceil(VF / NumRegs);
663662
auto *SubVecTy = FixedVectorType::get(Tp->getElementType(), SubVF);

llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ void SystemZTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
379379
// The z13 processor will run out of store tags if too many stores
380380
// are fed into it too quickly. Therefore make sure there are not
381381
// too many stores in the resulting unrolled loop.
382-
unsigned const NumStoresVal = *NumStores.getValue();
382+
unsigned const NumStoresVal = NumStores.getValue();
383383
unsigned const Max = (NumStoresVal ? (12 / NumStoresVal) : UINT_MAX);
384384

385385
if (HasCall) {

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,7 @@ InstructionCost X86TTIImpl::getShuffleCost(
17491749
getTypeLegalizationCost(
17501750
FixedVectorType::get(BaseTp->getElementType(), Mask.size()))
17511751
.first;
1752-
unsigned E = *NumOfDests.getValue();
1752+
unsigned E = NumOfDests.getValue();
17531753
unsigned NormalizedVF =
17541754
LegalVT.getVectorNumElements() * std::max(NumOfSrcs, E);
17551755
unsigned NumOfSrcRegs = NormalizedVF / LegalVT.getVectorNumElements();
@@ -4932,7 +4932,7 @@ InstructionCost X86TTIImpl::getScalarizationOverhead(
49324932
(LegalVectorBitWidth % LaneBitWidth) == 0) &&
49334933
"Illegal vector");
49344934

4935-
const int NumLegalVectors = *LT.first.getValue();
4935+
const int NumLegalVectors = LT.first.getValue();
49364936
assert(NumLegalVectors >= 0 && "Negative cost!");
49374937

49384938
// For insertions, a ISD::BUILD_VECTOR style vector initialization can be much
@@ -6166,7 +6166,7 @@ InstructionCost X86TTIImpl::getGSVectorCost(unsigned Opcode,
61666166
std::pair<InstructionCost, MVT> IdxsLT = getTypeLegalizationCost(IndexVTy);
61676167
std::pair<InstructionCost, MVT> SrcLT = getTypeLegalizationCost(SrcVTy);
61686168
InstructionCost::CostType SplitFactor =
6169-
*std::max(IdxsLT.first, SrcLT.first).getValue();
6169+
std::max(IdxsLT.first, SrcLT.first).getValue();
61706170
if (SplitFactor > 1) {
61716171
// Handle splitting of vector of pointers
61726172
auto *SplitSrcTy =

llvm/lib/Transforms/IPO/FunctionSpecialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ FunctionSpecializer::~FunctionSpecializer() {
662662
/// non-negative, which is true for both TCK_CodeSize and TCK_Latency, and
663663
/// always Valid.
664664
static unsigned getCostValue(const Cost &C) {
665-
int64_t Value = *C.getValue();
665+
int64_t Value = C.getValue();
666666

667667
assert(Value >= 0 && "CodeSize and Latency cannot be negative");
668668
// It is safe to down cast since we know the arguments cannot be negative and
@@ -713,7 +713,7 @@ bool FunctionSpecializer::run() {
713713
if (!SpecializeLiteralConstant && !Inserted && !Metrics.isRecursive)
714714
continue;
715715

716-
int64_t Sz = *Metrics.NumInsts.getValue();
716+
int64_t Sz = Metrics.NumInsts.getValue();
717717
assert(Sz > 0 && "CodeSize should be positive");
718718
// It is safe to down cast from int64_t, NumInsts is always positive.
719719
unsigned FuncSize = static_cast<unsigned>(Sz);

llvm/lib/Transforms/IPO/PartialInlining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ bool PartialInlinerImpl::tryPartialInline(FunctionCloner &Cloner) {
13201320
RelativeToEntryFreq = BranchProbability(0, 1);
13211321

13221322
BlockFrequency WeightedRcost =
1323-
BlockFrequency(*NonWeightedRcost.getValue()) * RelativeToEntryFreq;
1323+
BlockFrequency(NonWeightedRcost.getValue()) * RelativeToEntryFreq;
13241324

13251325
// The call sequence(s) to the outlined function(s) are larger than the sum of
13261326
// the original outlined region size(s), it does not increase the chances of

llvm/lib/Transforms/Scalar/ConstantHoisting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ void ConstantHoistingPass::collectConstantCandidates(
386386
ConstIntCandVec.push_back(ConstantCandidate(ConstInt));
387387
Itr->second = ConstIntCandVec.size() - 1;
388388
}
389-
ConstIntCandVec[Itr->second].addUser(Inst, Idx, *Cost.getValue());
389+
ConstIntCandVec[Itr->second].addUser(Inst, Idx, Cost.getValue());
390390
LLVM_DEBUG(if (isa<ConstantInt>(Inst->getOperand(Idx))) dbgs()
391391
<< "Collect constant " << *ConstInt << " from " << *Inst
392392
<< " with cost " << Cost << '\n';
@@ -446,7 +446,7 @@ void ConstantHoistingPass::collectConstantCandidates(
446446
ConstExpr));
447447
Itr->second = ExprCandVec.size() - 1;
448448
}
449-
ExprCandVec[Itr->second].addUser(Inst, Idx, *Cost.getValue());
449+
ExprCandVec[Itr->second].addUser(Inst, Idx, Cost.getValue());
450450
}
451451

452452
/// Check the operand for instruction Inst at index Idx.

llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ bool LoopDataPrefetch::runOnLoop(Loop *L) {
304304
if (!Metrics.NumInsts.isValid())
305305
return MadeChange;
306306

307-
unsigned LoopSize = *Metrics.NumInsts.getValue();
307+
unsigned LoopSize = Metrics.NumInsts.getValue();
308308
if (!LoopSize)
309309
LoopSize = 1;
310310

llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ void Cost::RateFormula(const Formula &F,
15351535
C.NumBaseAdds += (F.UnfoldedOffset.isNonZero());
15361536

15371537
// Accumulate non-free scaling amounts.
1538-
C.ScaleCost += *getScalingFactorCost(*TTI, LU, F, *L).getValue();
1538+
C.ScaleCost += getScalingFactorCost(*TTI, LU, F, *L).getValue();
15391539

15401540
// Tally up the non-zero immediates.
15411541
for (const LSRFixup &Fixup : LU.Fixups) {

llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,8 @@ static std::optional<EstimatedUnrollCost> analyzeLoopUnrollCost(
677677
LLVM_DEBUG(dbgs() << "Analysis finished:\n"
678678
<< "UnrolledCost: " << UnrolledCost << ", "
679679
<< "RolledDynamicCost: " << RolledDynamicCost << "\n");
680-
return {{unsigned(*UnrolledCost.getValue()),
681-
unsigned(*RolledDynamicCost.getValue())}};
680+
return {{unsigned(UnrolledCost.getValue()),
681+
unsigned(RolledDynamicCost.getValue())}};
682682
}
683683

684684
UnrollCostEstimator::UnrollCostEstimator(
@@ -729,7 +729,7 @@ bool UnrollCostEstimator::canUnroll() const {
729729
uint64_t UnrollCostEstimator::getUnrolledLoopSize(
730730
const TargetTransformInfo::UnrollingPreferences &UP,
731731
unsigned CountOverwrite) const {
732-
unsigned LS = *LoopSize.getValue();
732+
unsigned LS = LoopSize.getValue();
733733
assert(LS >= UP.BEInsns && "LoopSize should not be less than BEInsns!");
734734
if (CountOverwrite)
735735
return static_cast<uint64_t>(LS - UP.BEInsns) * CountOverwrite + UP.BEInsns;

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ class GeneratedRTChecks {
20032003
InstructionCost NewMemCheckCost = MemCheckCost / BestTripCount;
20042004

20052005
// Let's ensure the cost is always at least 1.
2006-
NewMemCheckCost = std::max(*NewMemCheckCost.getValue(),
2006+
NewMemCheckCost = std::max(NewMemCheckCost.getValue(),
20072007
(InstructionCost::CostType)1);
20082008

20092009
if (BestTripCount > 1)
@@ -5312,7 +5312,7 @@ LoopVectorizationCostModel::selectInterleaveCount(VPlan &Plan, ElementCount VF,
53125312
// to estimate the cost of the loop and interleave until the cost of the
53135313
// loop overhead is about 5% of the cost of the loop.
53145314
unsigned SmallIC = std::min(IC, (unsigned)llvm::bit_floor<uint64_t>(
5315-
SmallLoopCost / *LoopCost.getValue()));
5315+
SmallLoopCost / LoopCost.getValue()));
53165316

53175317
// Interleave until store/load ports (estimated by max interleave count) are
53185318
// saturated.
@@ -7652,7 +7652,7 @@ InstructionCost LoopVectorizationPlanner::cost(VPlan &Plan,
76527652
LLVM_DEBUG(dbgs() << "Cost for VF " << VF << ": " << Cost
76537653
<< " (Estimated cost per lane: ");
76547654
if (Cost.isValid()) {
7655-
double CostPerLane = double(*Cost.getValue()) / EstimatedWidth;
7655+
double CostPerLane = double(Cost.getValue()) / EstimatedWidth;
76567656
LLVM_DEBUG(dbgs() << format("%.1f", CostPerLane));
76577657
} else /* No point dividing an invalid cost - it will still be invalid */
76587658
LLVM_DEBUG(dbgs() << "Invalid");
@@ -10477,7 +10477,7 @@ static bool isOutsideLoopWorkProfitable(GeneratedRTChecks &Checks,
1047710477

1047810478
// The scalar cost should only be 0 when vectorizing with a user specified
1047910479
// VF/IC. In those cases, runtime checks should always be generated.
10480-
uint64_t ScalarC = *VF.ScalarCost.getValue();
10480+
uint64_t ScalarC = VF.ScalarCost.getValue();
1048110481
if (ScalarC == 0)
1048210482
return true;
1048310483

@@ -10512,8 +10512,8 @@ static bool isOutsideLoopWorkProfitable(GeneratedRTChecks &Checks,
1051210512
// the computations are performed on doubles, not integers and the result
1051310513
// is rounded up, hence we get an upper estimate of the TC.
1051410514
unsigned IntVF = getEstimatedRuntimeVF(VF.Width, VScale);
10515-
uint64_t RtC = *TotalCost.getValue();
10516-
uint64_t Div = ScalarC * IntVF - *VF.Cost.getValue();
10515+
uint64_t RtC = TotalCost.getValue();
10516+
uint64_t Div = ScalarC * IntVF - VF.Cost.getValue();
1051710517
uint64_t MinTC1 = Div == 0 ? 0 : divideCeil(RtC * IntVF, Div);
1051810518

1051910519
// Second, compute a minimum iteration count so that the cost of the

llvm/unittests/Support/InstructionCostTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TEST_F(CostTest, DefaultCtor) {
2323
InstructionCost DefaultCost;
2424

2525
ASSERT_TRUE(DefaultCost.isValid());
26-
EXPECT_EQ(*(DefaultCost.getValue()), 0);
26+
EXPECT_EQ(DefaultCost.getValue(), 0);
2727
}
2828

2929
TEST_F(CostTest, Operators) {
@@ -70,8 +70,8 @@ TEST_F(CostTest, Operators) {
7070
EXPECT_FALSE(TmpCost.isValid());
7171

7272
// Test value extraction
73-
EXPECT_EQ(*(VThree.getValue()), 3);
74-
EXPECT_EQ(IThreeA.getValue(), std::nullopt);
73+
EXPECT_EQ(VThree.getValue(), 3);
74+
EXPECT_EQ(IThreeA.getValueOr(10), 10);
7575

7676
EXPECT_EQ(std::min(VThree, VNegTwo), -2);
7777
EXPECT_EQ(std::max(VThree, VSix), 6);

0 commit comments

Comments
 (0)