Use has_value/value instead of hasValue/getValue (NFC)

This commit is contained in:
Kazu Hirata 2022-07-15 21:48:17 -07:00
parent 77b72fbc71
commit 1a5d007659
4 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -83,7 +83,7 @@ def Bufferization_AllocTensorOp : Bufferization_Op<"alloc_tensor",
bool bufferizesToAllocation(OpResult opResult) { return true; }
FailureOr<unsigned> getMemorySpace(OpResult opResult) {
if (getMemorySpace().hasValue())
if (getMemorySpace().has_value())
return static_cast<unsigned>(*getMemorySpace());
return failure();
}

View File

@ -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));

View File

@ -443,7 +443,7 @@ transform::PromoteOp::applyToOne(linalg::LinalgOp target,
if (!getUseFullTileBuffers().empty())
promotionOptions = promotionOptions.setUseFullTileBuffers(
llvm::to_vector(getUseFullTileBuffers().getAsValueRange<BoolAttr>()));
if (getAlignment().hasValue())
if (getAlignment().has_value())
promotionOptions = promotionOptions.setAlignment(*getAlignment());
if (failed(promoteSubviewsPrecondition(target, promotionOptions)))