[Mlir-commits] [mlir] 1a5d007 - Use has_value/value instead of hasValue/getValue (NFC)

Kazu Hirata llvmlistbot at llvm.org
Fri Jul 15 21:48:25 PDT 2022


Author: Kazu Hirata
Date: 2022-07-15T21:48:17-07:00
New Revision: 1a5d007659f4df741dd4a699bf278f833fc999f6

URL: https://github.com/llvm/llvm-project/commit/1a5d007659f4df741dd4a699bf278f833fc999f6
DIFF: https://github.com/llvm/llvm-project/commit/1a5d007659f4df741dd4a699bf278f833fc999f6.diff

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
    mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 25105ee2dbded..d46a0a23cca3e 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 df93e0eeb5dff..e2825b8695743 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<unsigned> getMemorySpace(OpResult opResult) {
-      if (getMemorySpace().hasValue())
+      if (getMemorySpace().has_value())
         return static_cast<unsigned>(*getMemorySpace());
       return failure();
     }

diff  --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index 1d5fe8923c2cc..0e2ec6df65c7c 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 a671e61635593..acdfe77263ac6 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<BoolAttr>()));
-  if (getAlignment().hasValue())
+  if (getAlignment().has_value())
     promotionOptions = promotionOptions.setAlignment(*getAlignment());
 
   if (failed(promoteSubviewsPrecondition(target, promotionOptions)))


        


More information about the Mlir-commits mailing list