File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
mlir/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1364,6 +1364,14 @@ Block *ConversionPatternRewriterImpl::applySignatureConversion(
13641364 if (hasRewrite<BlockTypeConversionRewrite>(rewrites, block))
13651365 llvm::report_fatal_error (" block was already converted" );
13661366#endif // MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS
1367+ #ifndef NDEBUG
1368+ // This check detects the following cases:
1369+ // * Attempting to convert the same block multiple times.
1370+ // * Block argument replaced, then attempting to convert the block.
1371+ for (BlockArgument arg : block->getArguments ())
1372+ assert (mapping.lookupOrNull (arg).empty () &&
1373+ " cannot convert block whose arguments have been replaced" );
1374+ #endif // NDEBUG
13671375
13681376 OpBuilder::InsertionGuard g (rewriter);
13691377
You can’t perform that action at this time.
0 commit comments