diff options
author | Fangrui Song <i@maskray.me> | 2022-12-16 23:21:27 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-16 23:21:27 +0000 |
commit | 51b685734b0e185bca9d0eec66b3bcb636ed9c02 (patch) | |
tree | 1d3cf7527fef8d8023e8de1858ef42a350be2747 /llvm/lib/CodeGen/SelectOptimize.cpp | |
parent | be931f89451b650e081daf875213c19f658caf25 (diff) | |
download | llvm-51b685734b0e185bca9d0eec66b3bcb636ed9c02.zip llvm-51b685734b0e185bca9d0eec66b3bcb636ed9c02.tar.gz llvm-51b685734b0e185bca9d0eec66b3bcb636ed9c02.tar.bz2 |
[Transforms,CodeGen] std::optional::value => operator*/operator->
value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).
Diffstat (limited to 'llvm/lib/CodeGen/SelectOptimize.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectOptimize.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp index 8c20406..5fd78ec 100644 --- a/llvm/lib/CodeGen/SelectOptimize.cpp +++ b/llvm/lib/CodeGen/SelectOptimize.cpp @@ -921,8 +921,8 @@ bool SelectOptimize::computeLoopCosts( EmitAndPrintRemark(ORE, ORmissL); return false; } - IPredCost += Scaled64::get(ILatency.value()); - INonPredCost += Scaled64::get(ILatency.value()); + IPredCost += Scaled64::get(*ILatency); + INonPredCost += Scaled64::get(*ILatency); // For a select that can be converted to branch, // compute its cost as a branch (non-predicated cost). |