Commit dc79abd1 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Enable -debug-only=dialect-conversion option for mlir tool

parent c79454d7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ static cl::opt<enum InputType> inputType(
    cl::values(clEnumValN(QASM, "qasm",
                          "load the input file as a qasm source.")));

static cl::opt<bool> mlir_debug_dialect_conversion(
    "debug-dialect-conversion",
    cl::desc("Debug the execution of the dialect conversion framework. Similar "
             "to '-debug-only=dialect-conversion'."));

int main(int argc, char **argv) {
  mlir::registerAsmPrinterCLOptions();
  mlir::registerMLIRContextCLOptions();
@@ -98,6 +103,12 @@ int main(int argc, char **argv) {

  llvm::cl::ParseCommandLineOptions(argc, argv,
                                    "qcor quantum assembly compiler\n");

  if (mlir_debug_dialect_conversion) {
    llvm::DebugFlag = true;
    llvm::setCurrentDebugType("dialect-conversion");
  }

  // If any *clang* optimization is requested, turn on quantum optimization as
  // well.
  bool qoptimizations =