[mlir] Fix forward the fix for incorrect Optional<ArrayAttr> usage.
authorAlexander Belyaev <pifon@google.com>
Fri, 11 Nov 2022 09:52:08 +0000 (10:52 +0100)
committerAlexander Belyaev <pifon@google.com>
Fri, 11 Nov 2022 09:53:04 +0000 (10:53 +0100)
mlir/lib/Dialect/SCF/IR/SCF.cpp

index 0cca4bc..6a85fb6 100644 (file)
@@ -1114,8 +1114,8 @@ LogicalResult ForeachThreadOp::verify() {
     if (body->getArgument(i + getRank()).getType() != getOutputs()[i].getType())
       return emitOpError("type mismatch between ")
              << i << "-th output and corresponding block argument";
-  if (getMapping()->getValue())
-    for (auto map : getMapping().value()) {
+   if (getMapping().has_value())
+    for (auto map : getMapping()->getValue()) {
       if (!isa<DeviceMappingAttrInterface>(map))
         return emitOpError()
                << getMappingAttrName() << " is not device mapping attribute";