aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectOptimize.cpp
diff options
context:
space:
mode:
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 00148b0..13ed8f2 100644
--- a/llvm/lib/CodeGen/SelectOptimize.cpp
+++ b/llvm/lib/CodeGen/SelectOptimize.cpp
@@ -206,7 +206,7 @@ public:
getI()->getOpcode(), I->getType(), TargetTransformInfo::TCK_Latency,
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None},
{TTI::OK_UniformConstantValue, TTI::OP_PowerOf2});
- auto TotalCost = Scaled64::get(*Cost.getValue());
+ auto TotalCost = Scaled64::get(Cost.getValue());
if (auto *OpI = dyn_cast<Instruction>(I->getOperand(1 - CondIdx))) {
auto It = InstCostMap.find(OpI);
if (It != InstCostMap.end())
@@ -1380,8 +1380,8 @@ std::optional<uint64_t>
SelectOptimizeImpl::computeInstCost(const Instruction *I) {
InstructionCost ICost =
TTI->getInstructionCost(I, TargetTransformInfo::TCK_Latency);
- if (auto OC = ICost.getValue())
- return std::optional<uint64_t>(*OC);
+ if (ICost.isValid())
+ return std::optional<uint64_t>(ICost.getValue());
return std::nullopt;
}