Skip to content

Commit

Permalink
[Analysis] Use llvm::Optional::value_or (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Nov 20, 2022
1 parent 510e5fb commit 7b91798
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/Analysis/LoopCacheAnalysis.cpp
Expand Up @@ -558,9 +558,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const CacheCost &CC) {
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) {
Expand Down

0 comments on commit 7b91798

Please sign in to comment.