diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 25105ee2dbde..d46a0a23cca3 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2286,8 +2286,8 @@ void SelectionDAGISel::Select_PATCHPOINT(SDNode *N) { // Finally, the regmask, chain and (if present) glue are moved to the end. Ops.push_back(RegMask); Ops.push_back(Chain); - if (Glue.hasValue()) - Ops.push_back(Glue.getValue()); + if (Glue.has_value()) + Ops.push_back(Glue.value()); SDVTList NodeTys = N->getVTList(); CurDAG->SelectNodeTo(N, TargetOpcode::PATCHPOINT, NodeTys, Ops); diff --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td index df93e0eeb5df..e2825b869574 100644 --- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td +++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td @@ -83,7 +83,7 @@ def Bufferization_AllocTensorOp : Bufferization_Op<"alloc_tensor", bool bufferizesToAllocation(OpResult opResult) { return true; } FailureOr getMemorySpace(OpResult opResult) { - if (getMemorySpace().hasValue()) + if (getMemorySpace().has_value()) return static_cast(*getMemorySpace()); return failure(); } diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td index 1d5fe8923c2c..0e2ec6df65c7 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -347,7 +347,7 @@ def LLVM_FNegOp : LLVM_UnaryFloatArithmeticOp< // of LLVM ops that accept such an attribute. class MemoryOpWithAlignmentBase { code setAlignmentCode = [{ - if ($alignment.hasValue()) { + if ($alignment.has_value()) { auto align = $alignment.value(); if (align != 0) inst->setAlignment(llvm::Align(align)); diff --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp index a671e6163559..acdfe77263ac 100644 --- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp +++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp @@ -443,7 +443,7 @@ transform::PromoteOp::applyToOne(linalg::LinalgOp target, if (!getUseFullTileBuffers().empty()) promotionOptions = promotionOptions.setUseFullTileBuffers( llvm::to_vector(getUseFullTileBuffers().getAsValueRange())); - if (getAlignment().hasValue()) + if (getAlignment().has_value()) promotionOptions = promotionOptions.setAlignment(*getAlignment()); if (failed(promoteSubviewsPrecondition(target, promotionOptions)))