Add a `-verify-roundtrip` option to `mlir-opt` intended to validate custom printer...
authorMehdi Amini <joker.eph@gmail.com>
Tue, 23 May 2023 10:04:21 +0000 (03:04 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 25 May 2023 22:15:47 +0000 (15:15 -0700)
commita6d09d4b1ac224ed90ee8ff6c964a2bff39421c7
treea3f1edda1b58c68b25c80e83727c44833b520134
parent7c847ac4bd1bd8a89c7fbb4581328fa8cb0498f1
Add a `-verify-roundtrip` option to `mlir-opt` intended to validate custom printer/parser completeness

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.

Reviewed By: rriddle, ftynse, jpienaar

Differential Revision: https://reviews.llvm.org/D90088
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