diff --git a/enzyme/Enzyme/FunctionUtils.cpp b/enzyme/Enzyme/FunctionUtils.cpp index 3ba92f96c5c2..5abc0a3729f3 100644 --- a/enzyme/Enzyme/FunctionUtils.cpp +++ b/enzyme/Enzyme/FunctionUtils.cpp @@ -4624,8 +4624,7 @@ std::optional fixSparse_inner(Instruction *cur, llvm::Function &F, if (fneg->getOperand(1) == PN) legal = false; if (cmpPredicate) { - if (cmpPredicate.value() != - cast(fneg)->getPredicate()) + if (*cmpPredicate != cast(fneg)->getPredicate()) legal = false; } else { cmpPredicate = cast(fneg)->getPredicate(); @@ -4727,7 +4726,7 @@ std::optional 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());