Commit 7a25bd1d authored by Matthias Kramm's avatar Matthias Kramm Committed by River Riddle
Browse files

[mlir][DialectConversion] Abort early if a subregion has a disconnected CFG.

Summary:
Make computeConversionSet bubble up errors from nested regions. Note
that this doesn't change top-level behavior - since the nested region
calls emitError, the error was visible before, just not surfaced as
quickly.

Differential Revision: https://reviews.llvm.org/D75369
parent 806bb1e0
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -51,9 +51,11 @@ computeConversionSet(iterator_range<Region::iterator> region,
                                 : Optional<ConversionTarget::LegalOpDetails>();
      if (legalityInfo && legalityInfo->isRecursivelyLegal)
        continue;
      for (auto &region : op.getRegions())
        computeConversionSet(region.getBlocks(), region.getLoc(), toConvert,
                             target);
      for (auto &region : op.getRegions()) {
        if (failed(computeConversionSet(region.getBlocks(), region.getLoc(),
                                        toConvert, target)))
          return failure();
      }
    }

    // Recurse to children that haven't been visited.