Skip to content

Commit 1db33f1

Browse files
[mlir][Transforms] Report all allowPatternRollback violations as fatal errors (#148416)
Report all `allowPatternRollback` API violations as fatal errors. If violated, the IR is potentially in an invalid/inconsistent state from which the driver cannot recover.
1 parent 43a9ec2 commit 1db33f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mlir/lib/Transforms/Utils/DialectConversion.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,9 +2266,8 @@ OperationLegalizer::legalizeWithPattern(Operation *op,
22662266
appliedPatterns.erase(&pattern);
22672267
if (failed(result)) {
22682268
if (!rewriterImpl.config.allowPatternRollback)
2269-
op->emitError("pattern '")
2270-
<< pattern.getDebugName()
2271-
<< "' produced IR that could not be legalized";
2269+
llvm::report_fatal_error("pattern '" + pattern.getDebugName() +
2270+
"' produced IR that could not be legalized");
22722271
rewriterImpl.resetState(curState, pattern.getDebugName());
22732272
}
22742273
if (config.listener)

0 commit comments

Comments
 (0)