diff --git a/tensorflow/compiler/mlir/xla/transforms/legalize_tf.cc b/tensorflow/compiler/mlir/xla/transforms/legalize_tf.cc index a6a6829b109..fb03c9b82e5 100644 --- a/tensorflow/compiler/mlir/xla/transforms/legalize_tf.cc +++ b/tensorflow/compiler/mlir/xla/transforms/legalize_tf.cc @@ -4785,6 +4785,17 @@ class ConvertQrOp : public OpRewritePattern { } }; +// Performs the lowering to XLA dialect. +void LegalizeTF::runOnFunction() { + if (failed(legalizeTF(getFunction(), allow_partial_conversion_))) + signalPassFailure(); +} + +static PassRegistration pass( + "xla-legalize-tf", "Legalize from TensorFlow to the XLA dialect"); + +} // end namespace + #include "tensorflow/compiler/mlir/xla/transforms/generated_legalize_tf.inc" LogicalResult legalizeTF(Operation *op, bool allow_partial_conversion) { @@ -4836,17 +4847,6 @@ LogicalResult legalizeTF(Operation *op, bool allow_partial_conversion) { return applyPartialConversion(op, target, patterns); } -/// Performs the lowering to XLA dialect. -void LegalizeTF::runOnFunction() { - if (failed(legalizeTF(getFunction(), allow_partial_conversion_))) - signalPassFailure(); -} - -static PassRegistration pass( - "xla-legalize-tf", "Legalize from TensorFlow to the XLA dialect"); - -} // end namespace - std::unique_ptr> createLegalizeTFPass( bool allow_partial_conversion) { return std::make_unique(allow_partial_conversion);