Register MLIR Context and PassManager option for tf_tfl_translate command line parsing

This makes available options like `--print-ir-after-all` to the user.

PiperOrigin-RevId: 308464862
Change-Id: Ida3eae90905f218b9c288eab399f7cef83ccf99f
This commit is contained in:
Mehdi Amini 2020-04-25 21:46:09 -07:00 committed by TensorFlower Gardener
parent 396f96e372
commit 5e7c9e2690

View File

@ -130,6 +130,8 @@ int main(int argc, char **argv) {
// interface. That also means we need to relay the value set in one option to
// all its aliases.
mlir::registerAsmPrinterCLOptions();
mlir::registerMLIRContextCLOptions();
mlir::registerPassManagerCLOptions();
llvm::cl::ParseCommandLineOptions(
argc, argv, "TF GraphDef to TFLite FlatBuffer converter\n");
@ -173,6 +175,7 @@ int main(int argc, char **argv) {
if (!module.ok()) return kTrFailure;
mlir::PassManager pm(&context);
applyPassManagerCLOptions(pm);
// Set the quantization specifications from the command line flags.
mlir::TFL::QuantizationSpecs quant_specs;