aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnroll.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-02 21:11:37 -0800
committerKazu Hirata <kazu@google.com>2022-12-02 21:11:37 -0800
commit343de6856e16b58bcbd16d479fc633f54e22fadc (patch)
tree31e3fbef03aa0e4c5ea9582d0eacc650aba3073d /llvm/lib/Transforms/Utils/LoopUnroll.cpp
parent998960ee1f2c8bc3830df4849ab89ec9d6217f26 (diff)
downloadllvm-343de6856e16b58bcbd16d479fc633f54e22fadc.zip
llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.tar.gz
llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.tar.bz2
[Transforms] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index bc3a30a..da8d375 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -703,7 +703,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
if (CompletelyUnroll) {
if (PreserveOnlyFirst) {
if (i == 0)
- return None;
+ return std::nullopt;
return j == 0;
}
// Complete (but possibly inexact) unrolling
@@ -711,7 +711,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
return true;
if (Info.TripCount && j != Info.TripCount)
return false;
- return None;
+ return std::nullopt;
}
if (ULO.Runtime) {
@@ -719,7 +719,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
// exits may be stale.
if (IsLatch && j != 0)
return false;
- return None;
+ return std::nullopt;
}
if (j != Info.BreakoutTrip &&
@@ -728,7 +728,7 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
// unconditional branch for some iterations.
return false;
}
- return None;
+ return std::nullopt;
};
// Fold branches for iterations where we know that they will exit or not