[llvm] 3e3be29 - [Scalar] Use std::optional in LoopPredication.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 17:18:59 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T17:18:54-08:00
New Revision: 3e3be2955bcb95129cffd318e5948be9aefe921a
URL: https://github.com/llvm/llvm-project/commit/3e3be2955bcb95129cffd318e5948be9aefe921a
DIFF: https://github.com/llvm/llvm-project/commit/3e3be2955bcb95129cffd318e5948be9aefe921a.diff
LOG: [Scalar] Use std::optional in LoopPredication.cpp (NFC)
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
Added:
Modified:
llvm/lib/Transforms/Scalar/LoopPredication.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
index 1e4060abeb88..77503a581070 100644
--- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
@@ -200,6 +200,7 @@
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
+#include <optional>
#define DEBUG_TYPE "loop-predication"
@@ -482,10 +483,10 @@ static bool isSafeToTruncateWideIVType(const DataLayout &DL,
// Return an LoopICmp describing a latch check equivlent to LatchCheck but with
// the requested type if safe to do so. May involve the use of a new IV.
-static Optional<LoopICmp> generateLoopLatchCheck(const DataLayout &DL,
- ScalarEvolution &SE,
- const LoopICmp LatchCheck,
- Type *RangeCheckType) {
+static std::optional<LoopICmp> generateLoopLatchCheck(const DataLayout &DL,
+ ScalarEvolution &SE,
+ const LoopICmp LatchCheck,
+ Type *RangeCheckType) {
auto *LatchType = LatchCheck.IV->getType();
if (RangeCheckType == LatchType)
More information about the llvm-commits
mailing list