From 33ff534790bb73d22c4b00bd273edd202ff92594 Mon Sep 17 00:00:00 2001 From: Sandeep Dasgupta Date: Fri, 18 Oct 2024 20:16:49 -0700 Subject: [PATCH] [HLO Componentization] Create hlo/transforms/ sub-component (Phase II). This CL takes care of 1. Migrating external projects dependencies from xla/service --> xla/hlo/transforms Phase I takes care of 1. Migrating xla/service/ --> xla/hlo/transforms/ 2. Setting up build aliases in xla/service ensuring external dependencies are still satisfied. PiperOrigin-RevId: 687508139 --- xla/service/BUILD | 98 +++++++++---------- xla/service/all_to_all_decomposer.h | 2 +- .../batched_gather_scatter_normalizer.h | 2 +- xla/service/buffer_assignment_test.cc | 4 +- xla/service/call_inliner.cc | 2 +- xla/service/collective_pipeliner.cc | 2 +- xla/service/conditional_code_motion.cc | 4 +- xla/service/copy_insertion.cc | 4 +- xla/service/dynamic_padder.cc | 2 +- xla/service/dynamic_padder_test.cc | 8 +- xla/service/gather_expander.h | 2 +- .../hlo_input_output_alias_config_test.cc | 2 - xla/service/hlo_module_dce.cc | 4 +- xla/service/hlo_module_test.cc | 2 +- xla/service/hlo_schedule_test.cc | 4 +- xla/service/latency_hiding_scheduler_test.cc | 2 +- xla/service/layout_assignment.cc | 4 +- xla/service/layout_assignment_test.cc | 2 +- xla/service/multi_output_fusion.cc | 2 +- ...scan_loop_accumulator_input_unification.cc | 2 +- xla/service/scatter_determinism_expander.h | 2 +- xla/service/scatter_expander.h | 2 +- xla/service/scatter_simplifier.h | 2 +- xla/service/select_and_scatter_expander.h | 2 +- xla/service/sharding_propagation_test.cc | 2 +- xla/service/topk_rewriter_test.cc | 4 +- xla/service/triangular_solve_expander.h | 2 +- xla/service/while_loop_concat_code_motion.cc | 4 +- .../while_loop_invariant_code_motion.cc | 2 +- xla/service/while_loop_pipeline_unroller.cc | 4 +- xla/service/while_loop_simplifier.cc | 2 +- xla/service/while_loop_simplifier_test.cc | 4 +- xla/service/while_loop_unroller.cc | 4 +- 33 files changed, 92 insertions(+), 98 deletions(-) diff --git a/xla/service/BUILD b/xla/service/BUILD index e443a16ce16d9..b965b14d03edf 100644 --- a/xla/service/BUILD +++ b/xla/service/BUILD @@ -362,8 +362,8 @@ cc_library( "//xla/hlo/ir:hlo_instruction_utils", "//xla/hlo/parser:hlo_parser", "//xla/hlo/pass:hlo_pass", + "//xla/hlo/transforms:hlo_dce", "//xla/hlo/utils:hlo_query", - "//xla/service:hlo_dce", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -587,8 +587,8 @@ xla_cc_test( "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", "//xla/hlo/transforms:hlo_constant_splitter", + "//xla/hlo/transforms:hlo_dce", "//xla/hlo/utils:hlo_matchers", - "//xla/service:hlo_dce", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "@com_google_absl//absl/log", @@ -898,13 +898,13 @@ cc_library( hdrs = ["call_inliner.h"], deps = [ ":call_graph", - ":hlo_dce", ":hlo_domain_isolator", "//xla:status_macros", "//xla:util", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", + "//xla/hlo/transforms:hlo_dce", "//xla/service/spmd/shardy:constants", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -1163,7 +1163,7 @@ xla_cc_test( "//xla:shape_util", "//xla:util", "//xla/hlo/ir:hlo", - "//xla/service:async_collective_creator", + "//xla/hlo/transforms:async_collective_creator", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "@com_google_absl//absl/algorithm:container", @@ -1695,9 +1695,9 @@ xla_cc_test( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", - "//xla/service:flatten_call_graph", - "//xla/service:hlo_dce", - "//xla/service:hlo_memory_scheduler", + "//xla/hlo/transforms:flatten_call_graph", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:hlo_memory_scheduler", "//xla/service/memory_space_assignment", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", @@ -1808,8 +1808,8 @@ xla_cc_test( "//xla:types", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", - "//xla/service:hlo_dce", - "//xla/service:hlo_memory_scheduler", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:hlo_memory_scheduler", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", @@ -1829,8 +1829,6 @@ xla_cc_test( "//xla:test_helpers", "//xla:types", "//xla/hlo/ir:hlo", - "//xla/service:hlo_dce", - "//xla/service:hlo_memory_scheduler", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", @@ -1917,7 +1915,7 @@ cc_library( "//xla/hlo/ir:hlo", "//xla/hlo/ir:hlo_reachability", "//xla/hlo/pass:hlo_pass", - "//xla/service:hlo_dce", + "//xla/hlo/transforms:hlo_dce", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/status:statusor", @@ -2043,7 +2041,7 @@ cc_library( "//xla:literal_util", "//xla:util", "//xla/hlo/ir:hlo", - "//xla/service:op_expander_pass", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/types:span", @@ -2094,7 +2092,7 @@ cc_library( ":while_util", "//xla:literal_util", "//xla/hlo/ir:hlo", - "//xla/service:op_expander_pass", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/status:statusor", ], @@ -2106,7 +2104,6 @@ cc_library( hdrs = ["scatter_determinism_expander.h"], deps = [ ":hlo_creation_utils", - ":op_expander_pass", ":scatter_utils", "//xla:array", "//xla:array2d", @@ -2116,6 +2113,7 @@ cc_library( "//xla:util", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/strings:str_format", "@tsl//tsl/platform:logging", @@ -2165,7 +2163,6 @@ cc_library( deps = [ ":hlo_creation_utils", ":hlo_module_config", - ":op_expander_pass", "//xla:shape_util", "//xla:util", "//xla/hlo/builder:xla_builder", @@ -2175,6 +2172,7 @@ cc_library( "//xla/hlo/builder/lib:matrix", "//xla/hlo/builder/lib:slicing", "//xla/hlo/ir:hlo", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", @@ -2606,8 +2604,8 @@ cc_library( "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", "//xla/hlo/pass:hlo_pass_pipeline", - "//xla/service:hlo_dce", - "//xla/service:tuple_simplifier", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:inlined_vector", @@ -2715,7 +2713,7 @@ cc_library( "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", - "//xla/service:tuple_simplifier", + "//xla/hlo/transforms:tuple_simplifier", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/log", "@com_google_absl//absl/status:statusor", @@ -2758,7 +2756,7 @@ cc_library( "//xla/hlo/evaluator:hlo_evaluator", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", - "//xla/service:algebraic_simplifier", + "//xla/hlo/transforms:algebraic_simplifier", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -2811,9 +2809,9 @@ cc_library( "//xla/hlo/evaluator:hlo_evaluator", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", + "//xla/hlo/transforms:flatten_call_graph", + "//xla/hlo/transforms:tuple_simplifier", "//xla/hlo/utils:hlo_query", - "//xla/service:flatten_call_graph", - "//xla/service:tuple_simplifier", "@com_google_absl//absl/algorithm", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_set", @@ -2873,8 +2871,8 @@ cc_library( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", + "//xla/hlo/transforms:hlo_dce", "//xla/hlo/utils:hlo_query", - "//xla/service:hlo_dce", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -2900,9 +2898,9 @@ xla_cc_test( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "//xla/hlo/utils:hlo_matchers", - "//xla/service:hlo_dce", - "//xla/service:tuple_simplifier", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", @@ -2962,7 +2960,7 @@ cc_library( "//xla:shape_util", "//xla:util", "//xla/hlo/ir:hlo", - "//xla/service:op_expander_pass", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:string_view", ], @@ -3118,7 +3116,7 @@ cc_library( "//xla/hlo/builder:xla_builder", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", - "//xla/service:hlo_dce", + "//xla/hlo/transforms:hlo_dce", "//xla/tsl/lib/monitoring:gauge", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_set", @@ -3156,11 +3154,11 @@ xla_test( "//xla/hlo/builder:xla_builder", "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", + "//xla/hlo/transforms:algebraic_simplifier", + "//xla/hlo/transforms:dynamic_dimension_simplifier", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "//xla/hlo/utils:hlo_matchers", - "//xla/service:algebraic_simplifier", - "//xla/service:dynamic_dimension_simplifier", - "//xla/service:hlo_dce", - "//xla/service:tuple_simplifier", "//xla/tests:client_library_test_base", "//xla/tests:hlo_test_base", "//xla/tests:literal_test_util", @@ -3458,8 +3456,8 @@ xla_cc_test( "//xla:xla_data_proto_cc", "//xla:xla_proto_cc", "//xla/hlo/ir:hlo", + "//xla/hlo/transforms:hlo_memory_scheduler", "//xla/hlo/utils:hlo_matchers", - "//xla/service:hlo_memory_scheduler", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", @@ -3550,8 +3548,6 @@ cc_library( ], ) -# Deprecated, use -# //third_party/tensorflow/compiler/xla/hlo/analysis:hlo_dataflow_analysis instead. cc_library( name = "hlo_dataflow_analysis", hdrs = ["hlo_dataflow_analysis.h"], @@ -3688,8 +3684,8 @@ cc_library( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", - "//xla/service:hlo_dce", - "//xla/service:tuple_simplifier", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -3722,11 +3718,9 @@ cc_library( ":hlo_alias_analysis", ":hlo_buffer", ":hlo_dataflow_analysis", - ":hlo_dce", ":hlo_graph_dumper", ":hlo_ordering", ":hlo_value", - ":tuple_simplifier", "//xla:frontend_attributes", "//xla:shape_tree", "//xla:shape_util", @@ -3735,6 +3729,8 @@ cc_library( "//xla/hlo/ir:hlo", "//xla/hlo/ir:hlo_reachability", "//xla/hlo/pass:hlo_pass", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "//xla/hlo/utils:hlo_query", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", @@ -3852,8 +3848,8 @@ cc_library( "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", - "//xla/service:hlo_dce", - "//xla/service:tuple_simplifier", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@tsl//tsl/platform:errors", @@ -4003,7 +3999,7 @@ xla_cc_test( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", - "//xla/service:algebraic_simplifier", + "//xla/hlo/transforms:algebraic_simplifier", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", @@ -4849,8 +4845,8 @@ cc_library( "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", "//xla/hlo/pass:hlo_pass_pipeline", - "//xla/service:hlo_dce", - "//xla/service:tuple_simplifier", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -4893,7 +4889,7 @@ cc_library( "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", - "//xla/service:hlo_dce", + "//xla/hlo/transforms:hlo_dce", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -5405,12 +5401,12 @@ xla_cc_test( name = "topk_rewriter_test", srcs = ["topk_rewriter_test.cc"], deps = [ - ":hlo_dce", ":pattern_matcher", ":pattern_matcher_gmock", ":topk_rewriter", - ":tuple_simplifier", "//xla/hlo/ir:hlo", + "//xla/hlo/transforms:hlo_dce", + "//xla/hlo/transforms:tuple_simplifier", "//xla/hlo/utils:hlo_matchers", "//xla/tests:hlo_test_base", "//xla/tests:literal_test_util", @@ -5709,7 +5705,7 @@ cc_library( "//xla:util", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", - "//xla/service:op_expander_pass", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:inlined_vector", "@com_google_absl//absl/types:span", @@ -5739,7 +5735,7 @@ cc_library( ":call_inliner", "//xla:literal_util", "//xla/hlo/ir:hlo", - "//xla/service:op_expander_pass", + "//xla/hlo/transforms:op_expander_pass", ], ) @@ -5812,7 +5808,7 @@ cc_library( "//xla:util", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", - "//xla/service:op_expander_pass", + "//xla/hlo/transforms:op_expander_pass", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/log:check", "@com_google_absl//absl/status", @@ -6204,11 +6200,11 @@ cc_library( hdrs = ["while_loop_pipeline_unroller.h"], deps = [ ":call_inliner", - ":flatten_call_graph", - ":hlo_dce", ":while_util", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass", + "//xla/hlo/transforms:flatten_call_graph", + "//xla/hlo/transforms:hlo_dce", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/log:check", diff --git a/xla/service/all_to_all_decomposer.h b/xla/service/all_to_all_decomposer.h index cca93ddcba0ff..f05e586692b81 100644 --- a/xla/service/all_to_all_decomposer.h +++ b/xla/service/all_to_all_decomposer.h @@ -19,7 +19,7 @@ limitations under the License. #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "xla/hlo/ir/hlo_instruction.h" -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/batched_gather_scatter_normalizer.h b/xla/service/batched_gather_scatter_normalizer.h index 4b5560d38dcee..50c1d43def029 100644 --- a/xla/service/batched_gather_scatter_normalizer.h +++ b/xla/service/batched_gather_scatter_normalizer.h @@ -18,7 +18,7 @@ limitations under the License. #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "xla/hlo/ir/hlo_instruction.h" -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/buffer_assignment_test.cc b/xla/service/buffer_assignment_test.cc index 908ad3f1e4ac6..ce71cd21b4e89 100644 --- a/xla/service/buffer_assignment_test.cc +++ b/xla/service/buffer_assignment_test.cc @@ -37,16 +37,16 @@ limitations under the License. #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_schedule.h" #include "xla/hlo/parser/hlo_parser.h" +#include "xla/hlo/transforms/simplifiers/flatten_call_graph.h" +#include "xla/hlo/transforms/simplifiers/hlo_memory_scheduler.h" #include "xla/literal.h" #include "xla/literal_util.h" #include "xla/service/buffer_value.h" #include "xla/service/call_graph.h" #include "xla/service/copy_insertion.h" -#include "xla/service/flatten_call_graph.h" #include "xla/service/hlo.pb.h" #include "xla/service/hlo_alias_analysis.h" #include "xla/service/hlo_buffer.h" -#include "xla/service/hlo_memory_scheduler.h" #include "xla/service/hlo_ordering.h" #include "xla/service/hlo_value.h" #include "xla/service/logical_buffer.h" diff --git a/xla/service/call_inliner.cc b/xla/service/call_inliner.cc index 9732be8286c2e..1fb8652110a77 100644 --- a/xla/service/call_inliner.cc +++ b/xla/service/call_inliner.cc @@ -31,8 +31,8 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_sharding_metadata.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/service/call_graph.h" -#include "xla/service/hlo_dce.h" #include "xla/service/hlo_domain_isolator.h" #include "xla/service/spmd/shardy/constants.h" #include "xla/status_macros.h" diff --git a/xla/service/collective_pipeliner.cc b/xla/service/collective_pipeliner.cc index 35cdb4ef26684..883019209687b 100644 --- a/xla/service/collective_pipeliner.cc +++ b/xla/service/collective_pipeliner.cc @@ -49,6 +49,7 @@ limitations under the License. #include "xla/hlo/ir/hlo_instructions.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/parser/hlo_parser.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/hlo/utils/hlo_query.h" #include "xla/literal.h" #include "xla/literal_util.h" @@ -57,7 +58,6 @@ limitations under the License. #include "xla/service/call_graph.h" #include "xla/service/collective_ops_utils.h" #include "xla/service/constant_value.h" -#include "xla/service/hlo_dce.h" #include "xla/service/tuple_points_to_analysis.h" #include "xla/service/value_range.h" #include "xla/shape.h" diff --git a/xla/service/conditional_code_motion.cc b/xla/service/conditional_code_motion.cc index 00f22ef9cf870..ee079970f2c46 100644 --- a/xla/service/conditional_code_motion.cc +++ b/xla/service/conditional_code_motion.cc @@ -39,12 +39,12 @@ limitations under the License. #include "xla/hlo/ir/hlo_instructions.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/pass/hlo_pass_pipeline.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/literal.h" #include "xla/map_util.h" #include "xla/service/hlo_cse.h" -#include "xla/service/hlo_dce.h" #include "xla/service/hlo_verifier.h" -#include "xla/service/tuple_simplifier.h" #include "xla/shape.h" #include "xla/shape_util.h" #include "xla/status_macros.h" diff --git a/xla/service/copy_insertion.cc b/xla/service/copy_insertion.cc index 2b03843606cfe..feb263255f128 100644 --- a/xla/service/copy_insertion.cc +++ b/xla/service/copy_insertion.cc @@ -44,6 +44,8 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_reachability.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/map_util.h" #include "xla/service/call_graph.h" #include "xla/service/compile_time_cap.h" @@ -51,10 +53,8 @@ limitations under the License. #include "xla/service/hlo_alias_analysis.h" #include "xla/service/hlo_buffer.h" #include "xla/service/hlo_dataflow_analysis.h" -#include "xla/service/hlo_dce.h" #include "xla/service/hlo_ordering.h" #include "xla/service/hlo_value.h" -#include "xla/service/tuple_simplifier.h" #include "xla/shape.h" #include "xla/shape_tree.h" #include "xla/shape_util.h" diff --git a/xla/service/dynamic_padder.cc b/xla/service/dynamic_padder.cc index a7392e0cff260..47ad65f3634ae 100644 --- a/xla/service/dynamic_padder.cc +++ b/xla/service/dynamic_padder.cc @@ -42,12 +42,12 @@ limitations under the License. #include "xla/hlo/ir/hlo_instructions.h" #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/literal_util.h" #include "xla/service/call_graph.h" #include "xla/service/dynamic_dimension_inference.h" #include "xla/service/dynamic_window_utils.h" #include "xla/service/hlo_creation_utils.h" -#include "xla/service/hlo_dce.h" #include "xla/service/pattern_matcher.h" #include "xla/service/shape_inference.h" #include "xla/service/tuple_util.h" diff --git a/xla/service/dynamic_padder_test.cc b/xla/service/dynamic_padder_test.cc index eabc05eace807..83acce7980d4f 100644 --- a/xla/service/dynamic_padder_test.cc +++ b/xla/service/dynamic_padder_test.cc @@ -34,16 +34,16 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/parser/hlo_parser.h" +#include "xla/hlo/transforms/simplifiers/algebraic_simplifier.h" +#include "xla/hlo/transforms/simplifiers/dynamic_dimension_simplifier.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/literal.h" #include "xla/literal_util.h" -#include "xla/service/algebraic_simplifier.h" #include "xla/service/dynamic_dimension_inference.h" -#include "xla/service/dynamic_dimension_simplifier.h" -#include "xla/service/hlo_dce.h" #include "xla/service/pattern_matcher.h" #include "xla/service/pattern_matcher_gmock.h" -#include "xla/service/tuple_simplifier.h" #include "xla/shape.h" #include "xla/shape_util.h" #include "xla/test.h" diff --git a/xla/service/gather_expander.h b/xla/service/gather_expander.h index 8f43141c3119e..334024cb12e0d 100644 --- a/xla/service/gather_expander.h +++ b/xla/service/gather_expander.h @@ -16,7 +16,7 @@ limitations under the License. #ifndef XLA_SERVICE_GATHER_EXPANDER_H_ #define XLA_SERVICE_GATHER_EXPANDER_H_ -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/hlo_input_output_alias_config_test.cc b/xla/service/hlo_input_output_alias_config_test.cc index 8b7a99b385db6..ab8f6925bdad4 100644 --- a/xla/service/hlo_input_output_alias_config_test.cc +++ b/xla/service/hlo_input_output_alias_config_test.cc @@ -23,8 +23,6 @@ limitations under the License. #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" -#include "xla/service/hlo_dce.h" -#include "xla/service/hlo_memory_scheduler.h" #include "xla/service/hlo_ordering.h" #include "xla/shape_util.h" #include "xla/test_helpers.h" diff --git a/xla/service/hlo_module_dce.cc b/xla/service/hlo_module_dce.cc index 81f8380bfb817..984404706e283 100644 --- a/xla/service/hlo_module_dce.cc +++ b/xla/service/hlo_module_dce.cc @@ -23,9 +23,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" -#include "xla/service/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/service/hlo_liveness_analysis.h" -#include "xla/service/tuple_simplifier.h" #include "xla/service/while_loop_simplifier.h" #include "xla/status_macros.h" #include "xla/types.h" diff --git a/xla/service/hlo_module_test.cc b/xla/service/hlo_module_test.cc index f2375751a90f5..d2052e8158408 100644 --- a/xla/service/hlo_module_test.cc +++ b/xla/service/hlo_module_test.cc @@ -28,10 +28,10 @@ limitations under the License. #include "absl/types/span.h" #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" +#include "xla/hlo/transforms/simplifiers/hlo_memory_scheduler.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/literal.h" #include "xla/service/computation_placer.h" -#include "xla/service/hlo_memory_scheduler.h" #include "xla/service/test_compilation_environment.pb.h" #include "xla/shape_util.h" #include "xla/test.h" diff --git a/xla/service/hlo_schedule_test.cc b/xla/service/hlo_schedule_test.cc index 4f96b30498b1c..d1ed746bbe452 100644 --- a/xla/service/hlo_schedule_test.cc +++ b/xla/service/hlo_schedule_test.cc @@ -25,8 +25,8 @@ limitations under the License. #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" -#include "xla/service/hlo_dce.h" -#include "xla/service/hlo_memory_scheduler.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/hlo_memory_scheduler.h" #include "xla/service/hlo_ordering.h" #include "xla/shape_util.h" #include "xla/test_helpers.h" diff --git a/xla/service/latency_hiding_scheduler_test.cc b/xla/service/latency_hiding_scheduler_test.cc index 60b00e642eb10..2397cdefa3f07 100644 --- a/xla/service/latency_hiding_scheduler_test.cc +++ b/xla/service/latency_hiding_scheduler_test.cc @@ -37,7 +37,7 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_schedule.h" -#include "xla/service/async_collective_creator.h" +#include "xla/hlo/transforms/collectives/async_collective_creator.h" #include "xla/service/hlo_cost_analysis.h" #include "xla/shape.h" #include "xla/shape_util.h" diff --git a/xla/service/layout_assignment.cc b/xla/service/layout_assignment.cc index 02885038251c0..ce88cd480aed4 100644 --- a/xla/service/layout_assignment.cc +++ b/xla/service/layout_assignment.cc @@ -42,16 +42,16 @@ limitations under the License. #include "xla/hlo/ir/hlo_instructions.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_sharding.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/layout.h" #include "xla/layout_util.h" #include "xla/map_util.h" #include "xla/permutation_util.h" #include "xla/service/call_graph.h" #include "xla/service/computation_layout.h" -#include "xla/service/hlo_dce.h" #include "xla/service/logical_buffer.h" #include "xla/service/tuple_points_to_analysis.h" -#include "xla/service/tuple_simplifier.h" #include "xla/shape.h" #include "xla/shape_layout.h" #include "xla/shape_util.h" diff --git a/xla/service/layout_assignment_test.cc b/xla/service/layout_assignment_test.cc index 371b3b200a190..fb24c1d83647c 100644 --- a/xla/service/layout_assignment_test.cc +++ b/xla/service/layout_assignment_test.cc @@ -29,11 +29,11 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/parser/hlo_parser.h" +#include "xla/hlo/transforms/simplifiers/algebraic_simplifier.h" #include "xla/layout.h" #include "xla/layout_util.h" #include "xla/literal.h" #include "xla/literal_util.h" -#include "xla/service/algebraic_simplifier.h" #include "xla/service/computation_layout.h" #include "xla/service/logical_buffer.h" #include "xla/service/pattern_matcher.h" diff --git a/xla/service/multi_output_fusion.cc b/xla/service/multi_output_fusion.cc index 779a292ac4334..51e75c715fdbb 100644 --- a/xla/service/multi_output_fusion.cc +++ b/xla/service/multi_output_fusion.cc @@ -22,8 +22,8 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_reachability.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/service/hlo_dataflow_analysis.h" -#include "xla/service/hlo_dce.h" #include "xla/shape_util.h" #include "xla/util.h" diff --git a/xla/service/scan_loop_accumulator_input_unification.cc b/xla/service/scan_loop_accumulator_input_unification.cc index 4470ae615eb7e..ea73178775afa 100644 --- a/xla/service/scan_loop_accumulator_input_unification.cc +++ b/xla/service/scan_loop_accumulator_input_unification.cc @@ -29,12 +29,12 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/literal_util.h" #include "xla/service/call_graph.h" #include "xla/service/hlo_alias_analysis.h" #include "xla/service/hlo_dataflow_analysis.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/tuple_simplifier.h" #include "xla/service/while_loop_simplifier.h" #include "xla/service/while_loop_unroller.h" #include "xla/shape_util.h" diff --git a/xla/service/scatter_determinism_expander.h b/xla/service/scatter_determinism_expander.h index a14ed4482e2ee..62c80346cad87 100644 --- a/xla/service/scatter_determinism_expander.h +++ b/xla/service/scatter_determinism_expander.h @@ -16,7 +16,7 @@ limitations under the License. #ifndef XLA_SERVICE_SCATTER_DETERMINISM_EXPANDER_H_ #define XLA_SERVICE_SCATTER_DETERMINISM_EXPANDER_H_ -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/scatter_expander.h b/xla/service/scatter_expander.h index 0658e96201745..fd19be4461b45 100644 --- a/xla/service/scatter_expander.h +++ b/xla/service/scatter_expander.h @@ -16,7 +16,7 @@ limitations under the License. #ifndef XLA_SERVICE_SCATTER_EXPANDER_H_ #define XLA_SERVICE_SCATTER_EXPANDER_H_ -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/scatter_simplifier.h b/xla/service/scatter_simplifier.h index 8b14e16abc9ff..42fbf443bfc88 100644 --- a/xla/service/scatter_simplifier.h +++ b/xla/service/scatter_simplifier.h @@ -17,7 +17,7 @@ limitations under the License. #define XLA_SERVICE_SCATTER_SIMPLIFIER_H_ #include "xla/hlo/ir/hlo_instructions.h" -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/select_and_scatter_expander.h b/xla/service/select_and_scatter_expander.h index 9e544972b3fec..bcaabdb6f2427 100644 --- a/xla/service/select_and_scatter_expander.h +++ b/xla/service/select_and_scatter_expander.h @@ -16,7 +16,7 @@ limitations under the License. #ifndef XLA_SERVICE_SELECT_AND_SCATTER_EXPANDER_H_ #define XLA_SERVICE_SELECT_AND_SCATTER_EXPANDER_H_ -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/sharding_propagation_test.cc b/xla/service/sharding_propagation_test.cc index a86f7cdf0e244..f0e227a3ced16 100644 --- a/xla/service/sharding_propagation_test.cc +++ b/xla/service/sharding_propagation_test.cc @@ -35,9 +35,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_sharding.h" #include "xla/hlo/parser/hlo_parser.h" #include "xla/hlo/transforms/simplifiers/hlo_constant_splitter.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/protobuf_util.h" -#include "xla/service/hlo_dce.h" #include "xla/shape_util.h" #include "xla/tests/hlo_test_base.h" #include "xla/util.h" diff --git a/xla/service/topk_rewriter_test.cc b/xla/service/topk_rewriter_test.cc index c678bef94e373..5eda22467dade 100644 --- a/xla/service/topk_rewriter_test.cc +++ b/xla/service/topk_rewriter_test.cc @@ -25,11 +25,11 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_instructions.h" #include "xla/hlo/ir/hlo_module.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/hlo/utils/hlo_matchers.h" -#include "xla/service/hlo_dce.h" #include "xla/service/pattern_matcher.h" #include "xla/service/pattern_matcher_gmock.h" -#include "xla/service/tuple_simplifier.h" #include "xla/tests/hlo_test_base.h" #include "xla/tests/literal_test_util.h" #include "xla/tsl/lib/core/status_test_util.h" diff --git a/xla/service/triangular_solve_expander.h b/xla/service/triangular_solve_expander.h index a5ff486498481..87aaf5612ce48 100644 --- a/xla/service/triangular_solve_expander.h +++ b/xla/service/triangular_solve_expander.h @@ -18,7 +18,7 @@ limitations under the License. #include "absl/container/flat_hash_map.h" #include "xla/hlo/builder/xla_builder.h" -#include "xla/service/op_expander_pass.h" +#include "xla/hlo/transforms/expanders/op_expander_pass.h" namespace xla { diff --git a/xla/service/while_loop_concat_code_motion.cc b/xla/service/while_loop_concat_code_motion.cc index f63c7afd9e96b..e1aa072d30ecc 100644 --- a/xla/service/while_loop_concat_code_motion.cc +++ b/xla/service/while_loop_concat_code_motion.cc @@ -32,8 +32,8 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/pass/hlo_pass_pipeline.h" -#include "xla/service/hlo_dce.h" -#include "xla/service/tuple_simplifier.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/service/while_loop_simplifier.h" #include "xla/shape_util.h" #include "xla/status_macros.h" diff --git a/xla/service/while_loop_invariant_code_motion.cc b/xla/service/while_loop_invariant_code_motion.cc index b1aae51df132e..c80385e985af1 100644 --- a/xla/service/while_loop_invariant_code_motion.cc +++ b/xla/service/while_loop_invariant_code_motion.cc @@ -30,9 +30,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/map_util.h" #include "xla/service/compile_time_cap.h" -#include "xla/service/hlo_dce.h" #include "xla/service/while_loop_analysis.h" #include "xla/service/while_util.h" #include "xla/shape.h" diff --git a/xla/service/while_loop_pipeline_unroller.cc b/xla/service/while_loop_pipeline_unroller.cc index 9e681a5dfff8d..19f74c72834d7 100644 --- a/xla/service/while_loop_pipeline_unroller.cc +++ b/xla/service/while_loop_pipeline_unroller.cc @@ -31,9 +31,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/hlo/transforms/simplifiers/flatten_call_graph.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/service/call_inliner.h" -#include "xla/service/flatten_call_graph.h" -#include "xla/service/hlo_dce.h" #include "xla/service/while_util.h" #include "tsl/platform/errors.h" #include "tsl/platform/statusor.h" diff --git a/xla/service/while_loop_simplifier.cc b/xla/service/while_loop_simplifier.cc index d6baca8c4e382..2a0905d3004a8 100644 --- a/xla/service/while_loop_simplifier.cc +++ b/xla/service/while_loop_simplifier.cc @@ -33,12 +33,12 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_instructions.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" #include "xla/hlo/utils/hlo_query.h" #include "xla/literal_util.h" #include "xla/primitive_util.h" #include "xla/service/call_inliner.h" #include "xla/service/hlo_creation_utils.h" -#include "xla/service/hlo_dce.h" #include "xla/service/pattern_matcher.h" #include "xla/service/while_loop_analysis.h" #include "xla/shape.h" diff --git a/xla/service/while_loop_simplifier_test.cc b/xla/service/while_loop_simplifier_test.cc index 683b016d3cb79..273f832ec5ce7 100644 --- a/xla/service/while_loop_simplifier_test.cc +++ b/xla/service/while_loop_simplifier_test.cc @@ -25,10 +25,10 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/parser/hlo_parser.h" +#include "xla/hlo/transforms/simplifiers/hlo_dce.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/literal_util.h" -#include "xla/service/hlo_dce.h" -#include "xla/service/tuple_simplifier.h" #include "xla/shape.h" #include "xla/shape_util.h" #include "xla/test.h" diff --git a/xla/service/while_loop_unroller.cc b/xla/service/while_loop_unroller.cc index 053c20aa8aa23..d8f2aa1125722 100644 --- a/xla/service/while_loop_unroller.cc +++ b/xla/service/while_loop_unroller.cc @@ -38,17 +38,17 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/pass/hlo_pass_fix.h" +#include "xla/hlo/transforms/simplifiers/flatten_call_graph.h" +#include "xla/hlo/transforms/simplifiers/tuple_simplifier.h" #include "xla/hlo/utils/hlo_query.h" #include "xla/literal.h" #include "xla/literal_util.h" #include "xla/overflow_util.h" #include "xla/service/call_inliner.h" #include "xla/service/collective_ops_utils.h" -#include "xla/service/flatten_call_graph.h" #include "xla/service/hlo_creation_utils.h" #include "xla/service/hlo_cse.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/tuple_simplifier.h" #include "xla/service/while_loop_analysis.h" #include "xla/service/while_loop_constant_sinking.h" #include "xla/shape.h"