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
#define DEBUG_TYPE "instcombine"
#include "llvm/Transforms/Utils/InstructionWorklist.h"
+#include <optional>
using namespace llvm;
using namespace llvm::PatternMatch;
// prove that the successor is not executed more frequently than our block.
// Return the UserBlock if successful.
auto getOptionalSinkBlockForInst =
- [this](Instruction *I) -> Optional<BasicBlock *> {
+ [this](Instruction *I) -> std::optional<BasicBlock *> {
if (!EnableCodeSinking)
return None;