Running:
MLIR_OPT_CHECK_IR_ROUNDTRIP=1 ninja check-mlir
will now exercises all of our test with a round-trip to bytecode and a comparison for equality.
Paths
| Differential D90088
Add a `-verify-roundtrip` option to `mlir-opt` intended to validate custom printer/parser completeness ClosedPublic Authored by mehdi_amini on Oct 23 2020, 7:30 PM.
Details Summary Running: MLIR_OPT_CHECK_IR_ROUNDTRIP=1 ninja check-mlir will now exercises all of our test with a round-trip to bytecode and a comparison for equality.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Oct 26 2020, 10:42 AM rriddle added inline comments.
Comment Actions
IMO, it depends on the user running mlir-opt. If I'm iterating locally, I generally wouldn't want these additional cost/complexity of running this. For tests that run automatically, that default is probably fine. I would strongly prefer that we keep mlir-opt defaults useful for users iterating locally and generally using mlir-opt as a development tool. For testing, could we just have another frontend(alias of mlir-opt?) that has better defaults for testing use cases? We've had conversations of sane defaults in the past, and it seems like the truly contentious ones always have this divide between local development and testing. Comment Actions
I'd also be pro not making it default from orthogonality point of view. Having all tests verifying printing/parsing vs having dedicated tests seems a wrong tradeoff. Yes having it default would catch cases not covered, but the fact that they aren't covered by unit tests is the problematic part that has to be addressed IMHO.
Herald added subscribers: dcaballe, cota, mravishankar, teijeong. · View Herald TranscriptJul 28 2021, 2:14 AM Comment Actions Add support for bytcode, fix location management which also uncover issues with singleblockimplicitterminator dropping locations :( mehdi_amini added inline comments.
This revision was landed with ongoing or failed builds.May 25 2023, 3:16 PM Closed by commit rGa6d09d4b1ac2: Add a `-verify-roundtrip` option to `mlir-opt` intended to validate custom… (authored by mehdi_amini). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 525480 mlir/include/mlir/IR/OperationSupport.h
mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
mlir/lib/IR/AsmPrinter.cpp
mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
mlir/test/lit.cfg.py
|
roundtripped module differs from reference? (The above are also errors in roundTrip testing)