[mlir] Fix incorrect access to the Optional<ArrayAttr> underlying values.
authorAlexander Belyaev <pifon@google.com>
Fri, 11 Nov 2022 09:46:04 +0000 (10:46 +0100)
committerAlexander Belyaev <pifon@google.com>
Fri, 11 Nov 2022 09:46:04 +0000 (10:46 +0100)
mlir/lib/Dialect/SCF/IR/SCF.cpp

index e32f671..0cca4bc 100644 (file)
@@ -1114,7 +1114,7 @@ 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().has_value())
+  if (getMapping()->getValue())
     for (auto map : getMapping().value()) {
       if (!isa<DeviceMappingAttrInterface>(map))
         return emitOpError()