[llvm] 7b91798 - [Analysis] Use llvm::Optional::value_or (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 19 21:11:17 PST 2022
Author: Kazu Hirata
Date: 2022-11-19T21:11:10-08:00
New Revision: 7b91798a5d3a8432b296778da4efe169012fb7b4
URL: https://github.com/llvm/llvm-project/commit/7b91798a5d3a8432b296778da4efe169012fb7b4
DIFF: https://github.com/llvm/llvm-project/commit/7b91798a5d3a8432b296778da4efe169012fb7b4.diff
LOG: [Analysis] Use llvm::Optional::value_or (NFC)
Added:
Modified:
llvm/lib/Analysis/LoopCacheAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LoopCacheAnalysis.cpp b/llvm/lib/Analysis/LoopCacheAnalysis.cpp
index 85f2dad86711..de8156a46cbc 100644
--- a/llvm/lib/Analysis/LoopCacheAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopCacheAnalysis.cpp
@@ -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) {
More information about the llvm-commits
mailing list