[Mlir-commits] [mlir] 7a25bd1 - [mlir][DialectConversion] Abort early if a subregion has a disconnected CFG.
River Riddle
llvmlistbot at llvm.org
Mon Mar 2 09:28:34 PST 2020
Author: Matthias Kramm
Date: 2020-03-02T09:28:21-08:00
New Revision: 7a25bd1d1950f39935afecdebf3c59d2b3f4eae4
URL: https://github.com/llvm/llvm-project/commit/7a25bd1d1950f39935afecdebf3c59d2b3f4eae4
DIFF: https://github.com/llvm/llvm-project/commit/7a25bd1d1950f39935afecdebf3c59d2b3f4eae4.diff
LOG: [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
Added:
Modified:
mlir/lib/Transforms/DialectConversion.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Transforms/DialectConversion.cpp b/mlir/lib/Transforms/DialectConversion.cpp
index 8e1a9cc942bd..ed81b588875c 100644
--- a/mlir/lib/Transforms/DialectConversion.cpp
+++ b/mlir/lib/Transforms/DialectConversion.cpp
@@ -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.
More information about the Mlir-commits
mailing list