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. // Finally, the regmask, chain and (if present) glue are moved to the end.
Ops.push_back(RegMask); Ops.push_back(RegMask);
Ops.push_back(Chain); Ops.push_back(Chain);
if (Glue.hasValue()) if (Glue.has_value())
Ops.push_back(Glue.getValue()); Ops.push_back(Glue.value());
SDVTList NodeTys = N->getVTList(); SDVTList NodeTys = N->getVTList();
CurDAG->SelectNodeTo(N, TargetOpcode::PATCHPOINT, NodeTys, Ops); 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; } bool bufferizesToAllocation(OpResult opResult) { return true; }
FailureOr<unsigned> getMemorySpace(OpResult opResult) { FailureOr<unsigned> getMemorySpace(OpResult opResult) {
if (getMemorySpace().hasValue()) if (getMemorySpace().has_value())
return static_cast<unsigned>(*getMemorySpace()); return static_cast<unsigned>(*getMemorySpace());
return failure(); return failure();
} }

View File

@ -347,7 +347,7 @@ def LLVM_FNegOp : LLVM_UnaryFloatArithmeticOp<
// of LLVM ops that accept such an attribute. // of LLVM ops that accept such an attribute.
class MemoryOpWithAlignmentBase { class MemoryOpWithAlignmentBase {
code setAlignmentCode = [{ code setAlignmentCode = [{
if ($alignment.hasValue()) { if ($alignment.has_value()) {
auto align = $alignment.value(); auto align = $alignment.value();
if (align != 0) if (align != 0)
inst->setAlignment(llvm::Align(align)); inst->setAlignment(llvm::Align(align));

View File

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