CacheCost::CacheCost(const LoopVectorTy &Loops, const LoopInfo &LI,
ScalarEvolution &SE, TargetTransformInfo &TTI,
AAResults &AA, DependenceInfo &DI, Optional<unsigned> TRT)
- : Loops(Loops),
- TRT((TRT == None) ? Optional<unsigned>(TemporalReuseThreshold) : TRT),
- LI(LI), SE(SE), TTI(TTI), AA(AA), DI(DI) {
+ : Loops(Loops), TRT(TRT.value_or(TemporalReuseThreshold)), LI(LI), SE(SE),
+ TTI(TTI), AA(AA), DI(DI) {
assert(!Loops.empty() && "Expecting a non-empty loop vector.");
for (const Loop *L : Loops) {