Skip to content

Commit

Permalink
Attempt std optional fix for older macos
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Nov 3, 2023
1 parent c808878 commit 7b00e71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions enzyme/Enzyme/FunctionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4624,8 +4624,7 @@ std::optional<std::string> fixSparse_inner(Instruction *cur, llvm::Function &F,
if (fneg->getOperand(1) == PN)
legal = false;
if (cmpPredicate) {
if (cmpPredicate.value() !=
cast<CmpInst>(fneg)->getPredicate())
if (*cmpPredicate != cast<CmpInst>(fneg)->getPredicate())
legal = false;
} else {
cmpPredicate = cast<CmpInst>(fneg)->getPredicate();
Expand Down Expand Up @@ -4727,7 +4726,7 @@ std::optional<std::string> fixSparse_inner(Instruction *cur, llvm::Function &F,
break;
case Instruction::FCmp:
case Instruction::ICmp:
fneg = B.CreateCmp(cmpPredicate.value(), lhsPN, rhsPN);
fneg = B.CreateCmp(*cmpPredicate, lhsPN, rhsPN);
break;
case Instruction::UIToFP:
fneg = B.CreateUIToFP(lhsPN, PN->getType());
Expand Down

0 comments on commit 7b00e71

Please sign in to comment.