diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp index a18291fb48b0d..0842462f445bb 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp @@ -44,6 +44,7 @@ #include "llvm/InitializePasses.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include #define DEBUG_TYPE "aarch64-postlegalizer-lowering" @@ -111,8 +112,8 @@ static bool isTRNMask(ArrayRef M, unsigned NumElts, /// Check if a G_EXT instruction can handle a shuffle mask \p M when the vector /// sources of the shuffle are different. -static Optional> getExtMask(ArrayRef M, - unsigned NumElts) { +static std::optional> getExtMask(ArrayRef M, + unsigned NumElts) { // Look for the first non-undef element. auto FirstRealElt = find_if(M, [](int Elt) { return Elt >= 0; }); if (FirstRealElt == M.end()) @@ -193,8 +194,8 @@ static bool isZipMask(ArrayRef M, unsigned NumElts, /// G_INSERT_VECTOR_ELT destination should be the LHS of the G_SHUFFLE_VECTOR. /// /// Second element is the destination lane for the G_INSERT_VECTOR_ELT. -static Optional> isINSMask(ArrayRef M, - int NumInputElements) { +static std::optional> isINSMask(ArrayRef M, + int NumInputElements) { if (M.size() != static_cast(NumInputElements)) return None; int NumLHSMatch = 0, NumRHSMatch = 0; @@ -557,9 +558,9 @@ static bool applyVAshrLshrImm(MachineInstr &MI, MachineRegisterInfo &MRI, /// be used to optimize the instruction. /// /// \note This assumes that the comparison has been legalized. -Optional> +std::optional> tryAdjustICmpImmAndPred(Register RHS, CmpInst::Predicate P, - const MachineRegisterInfo &MRI) { + const MachineRegisterInfo &MRI) { const auto &Ty = MRI.getType(RHS); if (Ty.isVector()) return None;