aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectOptimize.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-13 09:06:36 +0000
committerFangrui Song <i@maskray.me>2022-12-13 09:06:36 +0000
commit67819a72c6ba39267effe8edfc1befddc3f3f2f9 (patch)
tree9a95db915f8eded88767ac3e9c31c8db045ab505 /llvm/lib/CodeGen/SelectOptimize.cpp
parent48e6ff9ad3eb1971de6d7ba12e31754781aff675 (diff)
downloadllvm-67819a72c6ba39267effe8edfc1befddc3f3f2f9.zip
llvm-67819a72c6ba39267effe8edfc1befddc3f3f2f9.tar.gz
llvm-67819a72c6ba39267effe8edfc1befddc3f3f2f9.tar.bz2
[CodeGen] llvm::Optional => std::optional
Diffstat (limited to 'llvm/lib/CodeGen/SelectOptimize.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectOptimize.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp
index ad73e76..5d4d982 100644
--- a/llvm/lib/CodeGen/SelectOptimize.cpp
+++ b/llvm/lib/CodeGen/SelectOptimize.cpp
@@ -200,7 +200,7 @@ private:
SmallPtrSet<const Instruction *, 2> getSIset(const SelectGroups &SIGroups);
// Returns the latency cost of a given instruction.
- Optional<uint64_t> computeInstCost(const Instruction *I);
+ std::optional<uint64_t> computeInstCost(const Instruction *I);
// Returns the misprediction cost of a given select when converted to branch.
Scaled64 getMispredictionCost(const SelectInst *SI, const Scaled64 CondCost);
@@ -977,11 +977,11 @@ SelectOptimize::getSIset(const SelectGroups &SIGroups) {
return SIset;
}
-Optional<uint64_t> SelectOptimize::computeInstCost(const Instruction *I) {
+std::optional<uint64_t> SelectOptimize::computeInstCost(const Instruction *I) {
InstructionCost ICost =
TTI->getInstructionCost(I, TargetTransformInfo::TCK_Latency);
if (auto OC = ICost.getValue())
- return Optional<uint64_t>(*OC);
+ return std::optional<uint64_t>(*OC);
return std::nullopt;
}