[mlir-opt] Delay pass manager creation until after parsing
authorrkayaith <rkayaith@gmail.com>
Fri, 9 Sep 2022 01:39:55 +0000 (21:39 -0400)
committerrkayaith <rkayaith@gmail.com>
Wed, 28 Sep 2022 00:34:20 +0000 (20:34 -0400)
commit7e22179d38c438fedb0d9bb0cff1585843bd7082
treeaaac0219affec307c60b36523efe7a784c5dffb4
parentc595c874cb32564d05a31b565a41d67b3319533e
[mlir-opt] Delay pass manager creation until after parsing

Currently the pass manager is created before parsing, which requires an
assumption that the top-level operation will be `builtin.module`.
Delaying the creation allows for using the parsed top-level operation as
the PassManager operation instead.

A followup change will allow for parsing top-level operations other than
`builtin.module`.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133644
mlir/include/mlir/Pass/PassRegistry.h
mlir/lib/Pass/PassCrashRecovery.cpp
mlir/lib/Tools/mlir-opt/MlirOptMain.cpp