[llvm] 7e00820 - [RISCV] Use std::optional in RISCVGatherScatterLowering.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 23:00:04 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T22:59:57-08:00
New Revision: 7e008206863f3e274966c1dba1edfc0db1ed0cb3

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

LOG: [RISCV] Use std::optional in RISCVGatherScatterLowering.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/Target/RISCV/RISCVGatherScatterLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
index 262f4a35ecc25..435711e837809 100644
--- a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
@@ -23,6 +23,7 @@
 #include "llvm/IR/IntrinsicsRISCV.h"
 #include "llvm/IR/PatternMatch.h"
 #include "llvm/Transforms/Utils/Local.h"
+#include <optional>
 
 using namespace llvm;
 using namespace PatternMatch;
@@ -346,7 +347,7 @@ RISCVGatherScatterLowering::determineBaseAndStride(GetElementPtrInst *GEP,
   if (Ops[0]->getType()->isVectorTy())
     return std::make_pair(nullptr, nullptr);
 
-  Optional<unsigned> VecOperand;
+  std::optional<unsigned> VecOperand;
   unsigned TypeScale = 0;
 
   // Look for a vector operand and scale.


        


More information about the llvm-commits mailing list