[llvm] 5fc8f6c - [Vectorize] Use std::optional in SLPVectorizer.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 18:03:55 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T18:03:49-08:00
New Revision: 5fc8f6c37c33195ebac70f08227cfa9aae40f158

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

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index cbf57366126e..1715d4eb6dc2 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -94,6 +94,7 @@
 #include <cstdint>
 #include <iterator>
 #include <memory>
+#include <optional>
 #include <set>
 #include <string>
 #include <tuple>
@@ -12797,7 +12798,7 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
       return true;
     if (Opcodes1.size() > Opcodes2.size())
       return false;
-    Optional<bool> ConstOrder;
+    std::optional<bool> ConstOrder;
     for (int I = 0, E = Opcodes1.size(); I < E; ++I) {
       // Undefs are compatible with any other value.
       if (isa<UndefValue>(Opcodes1[I]) || isa<UndefValue>(Opcodes2[I])) {


        


More information about the llvm-commits mailing list