diff --git a/mlir/lib/Transforms/DialectConversion.cpp b/mlir/lib/Transforms/DialectConversion.cpp --- a/mlir/lib/Transforms/DialectConversion.cpp +++ b/mlir/lib/Transforms/DialectConversion.cpp @@ -51,9 +51,11 @@ : Optional(); if (legalityInfo && legalityInfo->isRecursivelyLegal) continue; - for (auto ®ion : op.getRegions()) - computeConversionSet(region.getBlocks(), region.getLoc(), toConvert, - target); + for (auto ®ion : op.getRegions()) { + if (failed(computeConversionSet(region.getBlocks(), region.getLoc(), + toConvert, target))) + return failure(); + } } // Recurse to children that haven't been visited.