[llvm] f207cf1 - [Scalar] Use std::optional in LoopStrengthReduce.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 17:27:02 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T17:26:57-08:00
New Revision: f207cf1d93787696ce130a1deeb1f11196e528ec

URL: https://github.com/llvm/llvm-project/commit/f207cf1d93787696ce130a1deeb1f11196e528ec
DIFF: https://github.com/llvm/llvm-project/commit/f207cf1d93787696ce130a1deeb1f11196e528ec.diff

LOG: [Scalar] Use std::optional in LoopStrengthReduce.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/LoopStrengthReduce.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 697d6e467db1..20aa801be793 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -124,6 +124,7 @@
 #include <limits>
 #include <map>
 #include <numeric>
+#include <optional>
 #include <utility>
 
 using namespace llvm;
@@ -6614,7 +6615,7 @@ static llvm::PHINode *GetInductionVariable(const Loop &L, ScalarEvolution &SE,
   return nullptr;
 }
 
-static Optional<std::pair<PHINode *, std::pair<PHINode *, const SCEV *>>>
+static std::optional<std::pair<PHINode *, std::pair<PHINode *, const SCEV *>>>
 canFoldTermCondOfLoop(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
                       const LoopInfo &LI) {
   if (!L->isInnermost()) {


        


More information about the llvm-commits mailing list