[PATCH] D148521: [VP] Change getVPForBaseOpcode to return std::optional

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 10:03:56 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:937
   SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue Operand) {
-    unsigned VPOpcode = ISD::getVPForBaseOpcode(Opcode);
+    unsigned VPOpcode = ISD::getVPForBaseOpcode(Opcode).value();
     assert(ISD::getVPMaskIdx(VPOpcode) == 1 &&
----------------
I think we're supposed to use operator* instead of value(). 

There were commits like this in December

```
[lldb] llvm::Optional::value() && => operator*/operator->
    
    std::optional::value() has undesired exception checking semantics and is
    unavailable in older Xcode (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). The
    call sites block std::optional migration.
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148521/new/

https://reviews.llvm.org/D148521



More information about the llvm-commits mailing list