mlir-hlo/lib/Dialect/mhlo/transforms
Ehsan Toosi d599485e06 PR #43069: [hlo] Unbreak hlo-legalize-to-lhlo test
Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/43069

The legalization of mlhlo.ReturnOp to lhlo.TerminatorOp by using BufferAssignmentReturnOpConverter fails since the Memref typed results (or the Memref typed operands of Return operation) are set to stay as results after legalization but lhlo.TerminatorOp doesn't accept any operands. Therefore, BufferAssignmentReturnOpConverter must be replaced with a manual conversion that removes all operands of mlhlo.ReturnOp and inserts copy operations in their places.
Copybara import of the project:

--
8be0435b0147263c3872bedec58fd215f784b450 by Ehsan Toosi <ehsan.nadjaran_toosi@dfki.de>:

[hlo] Unbreak hlo-legalize-to-lhlo test

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/43069 from dfki-ehna:fix_hlo_legalize_to_lhlo_test 8be0435b0147263c3872bedec58fd215f784b450
PiperOrigin-RevId: 330907602
2020-09-10 04:09:03 -07:00
..
CMakeLists.txt [mhlo] Add legalize to SCF pass 2020-08-28 15:11:58 -07:00
chlo_legalize_to_hlo.cc [MLIR][XLA] Allow for choice of safe/unsafe variant in broadcast utils 2020-08-07 22:16:11 -07:00
chlo_legalize_to_hlo_pass.cc Remove the dependency on global dialect registry from mlir-hlo 2020-08-25 20:30:42 -07:00
hlo_legalize_to_lhlo.cc PR #43069: [hlo] Unbreak hlo-legalize-to-lhlo test 2020-09-10 04:09:03 -07:00
legalize_control_flow.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
legalize_gather_to_torch_index_select.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
legalize_tanh_to_approximation.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
legalize_to_linalg.cc Add support for legalizing lmhlo.transpose to linalg.generic 2020-09-04 15:37:42 -07:00
legalize_to_standard.cc Integrate LLVM at llvm/llvm-project@202766947e 2020-09-02 02:27:52 -07:00
legalize_to_standard_patterns.td Lowering for mhlo.ceil to std.ceil 2020-08-12 16:15:35 -07:00
lhlo_copy_removal.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
lhlo_fuse_linalg.cc Remove the dependency on global dialect registry from mlir-hlo 2020-08-25 20:30:42 -07:00
lhlo_legalize_to_affine.cc Remove the dependency on global dialect registry from mlir-hlo 2020-08-25 20:30:42 -07:00
lhlo_legalize_to_gpu.cc Remove the dependency on global dialect registry from mlir-hlo 2020-08-25 20:30:42 -07:00
lhlo_legalize_to_llvm.cc Integrate LLVM at llvm/llvm-project@9dbdaea9a0 2020-08-07 22:20:06 -07:00
lhlo_legalize_to_llvm_pass.cc Remove the dependency on global dialect registry from mlir-hlo 2020-08-25 20:30:42 -07:00
lhlo_legalize_to_parallel_loops.cc Remove the dependency on global dialect registry from mlir-hlo 2020-08-25 20:30:42 -07:00
lower_complex.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
lower_complex_patterns.td More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
lower_general_dot.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
materialize_broadcasts.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
materialize_broadcasts_pass.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
mhlo_control_flow_to_scf.cc Integrate LLVM at llvm/llvm-project@202766947e 2020-09-02 02:27:52 -07:00
mhlo_fusion.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
optimize_mhlo.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
optimize_mhlo_pass.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
sink_constants_to_control_flow.cc Internal change 2020-08-03 22:59:44 -07:00
test_infer_shaped_type_pass.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00
transform_unranked_hlo.cc [MLIR][KERNEL_GEN] Add a library to lower kernels with the host side. 2020-09-08 06:06:29 -07:00
unfuse_batch_norm.cc Integrate LLVM at llvm/llvm-project@202766947e 2020-09-02 02:27:52 -07:00
unfuse_batch_norm_pass.cc More cleanup in mlir-hlo to prepare for the standalone build 2020-08-03 19:28:00 -07:00