[mlir] Making verification after parsing optional

This is very useful when you want to parse IR even if
its invalid (e.g. bytecode). It's also useful if you don't
want to pay the cost of verification in certain situations.

Differential Revision: https://reviews.llvm.org/D134847
This commit is contained in:
River Riddle
2022-09-28 18:39:26 -07:00
parent b947e15a57
commit 1ae60e044e
7 changed files with 47 additions and 7 deletions

View File

@@ -1408,7 +1408,7 @@ LogicalResult BytecodeReader::parseIRSection(ArrayRef<uint8_t> sectionData,
}
// Verify that the parsed operations are valid.
if (failed(verify(*moduleOp)))
if (config.shouldVerifyAfterParse() && failed(verify(*moduleOp)))
return failure();
// Splice the parsed operations over to the provided top-level block.