forked from OSchip/llvm-project
[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
This commit is contained in:
parent
806bb1e029
commit
7a25bd1d19
|
@ -51,9 +51,11 @@ computeConversionSet(iterator_range<Region::iterator> region,
|
|||
: Optional<ConversionTarget::LegalOpDetails>();
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue