Update third_party/tensorflow/compiler/mlir/tensorflow/utils/... to not depend on the global Dialect Registry (NFC)

PiperOrigin-RevId: 328171679
This commit is contained in:
Mehdi Amini 2020-08-24 10:58:19 -07:00 committed by TensorFlow MLIR Team
parent 6434448813
commit 73b5a44f33
2 changed files with 11 additions and 0 deletions

View File

@ -17,10 +17,13 @@ limitations under the License.
#define MLIR_HLO_DIALECT_MHLO_IR_REGISTER_H_ #define MLIR_HLO_DIALECT_MHLO_IR_REGISTER_H_
namespace mlir { namespace mlir {
class DialectRegistry;
namespace mhlo { namespace mhlo {
void registerAllDialects(); void registerAllDialects();
// Add chlo, mhlo, lmhlo dialects to the provided registry.
void registerAllMhloDialects(DialectRegistry &registry);
} }
} // namespace mlir } // namespace mlir

View File

@ -31,3 +31,11 @@ void mlir::mhlo::registerAllDialects() {
// Dependent dialects // Dependent dialects
} }
void mlir::mhlo::registerAllMhloDialects(mlir::DialectRegistry &registry) {
// clang-format off
registry.insert<mlir::chlo::HloClientDialect,
mlir::lmhlo::LmhloDialect,
mlir::mhlo::MhloDialect>();
// clang-format on
}