From 41c638875e28df6d7c893fadda362213d535e6f8 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 26 Nov 2022 18:11:32 -0800 Subject: [PATCH] [Vectorize] Use std::optional in VPlanSLP.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 --- llvm/lib/Transforms/Vectorize/VPlanSLP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp b/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp index 0210afa..3ac45ea 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp @@ -29,6 +29,7 @@ #include "llvm/Support/raw_ostream.h" #include #include +#include #include using namespace llvm; @@ -187,7 +188,7 @@ getOperands(ArrayRef Values) { } /// Returns the opcode of Values or ~0 if they do not all agree. -static Optional getOpcode(ArrayRef Values) { +static std::optional getOpcode(ArrayRef Values) { unsigned Opcode = cast(Values[0])->getOpcode(); if (any_of(Values, [Opcode](VPValue *V) { return cast(V)->getOpcode() != Opcode; -- 2.7.4