1# Description:
2#   XLA service implementation.
3
4load("//tensorflow/compiler/xla/tests:build_defs.bzl", "xla_test")
5load("//tensorflow/compiler/xla:xla.bzl", "xla_proto_library")
6load(
7    "//tensorflow/core:platform/default/build_config.bzl",
8    "tf_proto_library_py",
9)
10load("//tensorflow:tensorflow.bzl", "tf_cc_binary", "tf_cc_test")
11
12licenses(["notice"])  # Apache 2.0
13
14package(default_visibility = [":friends"])
15
16package_group(
17    name = "friends",
18    includes = [
19        "//tensorflow/compiler/xla:friends",
20    ],
21)
22
23xla_proto_library(
24    name = "hlo_proto",
25    srcs = ["hlo.proto"],
26    visibility = ["//visibility:public"],
27    deps = ["//tensorflow/compiler/xla:xla_data_proto"],
28)
29
30tf_proto_library_py(
31    name = "hlo_proto",  # bzl adds a _py suffix only to the OSS target.
32    srcs = ["hlo.proto"],
33    visibility = ["//visibility:public"],
34    deps = ["//tensorflow/compiler/xla:xla_data_proto_py"],
35)
36
37xla_proto_library(
38    name = "hlo_profile_printer_data",
39    srcs = ["hlo_profile_printer_data.proto"],
40)
41
42# Filegroup used to collect source files for dependency checking.
43filegroup(
44    name = "c_srcs",
45    data = glob([
46        "**/*.cc",
47        "**/*.h",
48    ]),
49)
50
51cc_library(
52    name = "bfloat16_support",
53    srcs = ["bfloat16_support.cc"],
54    hdrs = ["bfloat16_support.h"],
55    deps = [
56        ":hlo",
57    ],
58)
59
60cc_library(
61    name = "bfloat16_conversion_folding",
62    srcs = ["bfloat16_conversion_folding.cc"],
63    hdrs = ["bfloat16_conversion_folding.h"],
64    deps = [
65        ":bfloat16_support",
66        ":hlo",
67        ":hlo_pass",
68        "//tensorflow/compiler/xla:status_macros",
69        "//tensorflow/compiler/xla:xla_data_proto",
70        "//tensorflow/core:lib",
71        "@com_google_absl//absl/types:span",
72    ],
73)
74
75tf_cc_test(
76    name = "bfloat16_conversion_folding_test",
77    srcs = ["bfloat16_conversion_folding_test.cc"],
78    deps = [
79        ":bfloat16_conversion_folding",
80        ":bfloat16_support",
81        ":hlo",
82        "//tensorflow/compiler/xla:shape_util",
83        "//tensorflow/compiler/xla:status_macros",
84        "//tensorflow/compiler/xla:test",
85        "//tensorflow/compiler/xla:test_helpers",
86        "//tensorflow/compiler/xla:types",
87        "//tensorflow/compiler/xla:xla_data_proto",
88        "//tensorflow/compiler/xla/tests:hlo_test_base",
89        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
90        "//tensorflow/core:lib",
91    ],
92)
93
94cc_library(
95    name = "bfloat16_normalization",
96    srcs = ["bfloat16_normalization.cc"],
97    hdrs = ["bfloat16_normalization.h"],
98    deps = [
99        ":bfloat16_support",
100        ":hlo",
101        ":hlo_pass",
102        "//tensorflow/compiler/xla:shape_util",
103        "//tensorflow/compiler/xla:status_macros",
104        "//tensorflow/compiler/xla:xla_data_proto",
105        "//tensorflow/core:lib",
106        "@com_google_absl//absl/types:span",
107    ],
108)
109
110tf_cc_test(
111    name = "bfloat16_normalization_test",
112    srcs = ["bfloat16_normalization_test.cc"],
113    deps = [
114        ":bfloat16_normalization",
115        ":bfloat16_support",
116        ":hlo",
117        ":hlo_creation_utils",
118        ":hlo_verifier",
119        "//tensorflow/compiler/xla:shape_util",
120        "//tensorflow/compiler/xla:status_macros",
121        "//tensorflow/compiler/xla:test",
122        "//tensorflow/compiler/xla:test_helpers",
123        "//tensorflow/compiler/xla:types",
124        "//tensorflow/compiler/xla:xla_data_proto",
125        "//tensorflow/compiler/xla/tests:hlo_test_base",
126        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
127        "//tensorflow/core:lib",
128    ],
129)
130
131cc_library(
132    name = "bfloat16_propagation",
133    srcs = ["bfloat16_propagation.cc"],
134    hdrs = ["bfloat16_propagation.h"],
135    deps = [
136        ":bfloat16_support",
137        ":hlo",
138        ":hlo_dataflow_analysis",
139        ":hlo_dce",
140        ":hlo_pass",
141        ":tuple_simplifier",
142        "//tensorflow/compiler/xla:literal",
143        "//tensorflow/compiler/xla:shape_tree",
144        "//tensorflow/compiler/xla:shape_util",
145        "//tensorflow/compiler/xla:util",
146        "//tensorflow/core:lib",
147        "@com_google_absl//absl/container:flat_hash_map",
148        "@com_google_absl//absl/container:flat_hash_set",
149    ],
150)
151
152tf_cc_test(
153    name = "bfloat16_propagation_test",
154    srcs = ["bfloat16_propagation_test.cc"],
155    deps = [
156        ":bfloat16_propagation",
157        ":bfloat16_support",
158        ":hlo",
159        "//tensorflow/compiler/xla:literal_util",
160        "//tensorflow/compiler/xla:shape_util",
161        "//tensorflow/compiler/xla:test",
162        "//tensorflow/compiler/xla:test_helpers",
163        "//tensorflow/compiler/xla:xla_data_proto",
164        "//tensorflow/compiler/xla/tests:hlo_test_base",
165        "//tensorflow/compiler/xla/tests:literal_test_util",
166        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
167    ],
168)
169
170cc_library(
171    name = "dump",
172    srcs = ["dump.cc"],
173    hdrs = ["dump.h"],
174    deps = [
175        ":hlo",
176        ":hlo_graph_dumper",
177        ":hlo_proto_util",
178        "//tensorflow/compiler/xla:status",
179        "//tensorflow/compiler/xla:util",
180        "//tensorflow/compiler/xla:xla_proto",
181        "//tensorflow/core:lib",
182        "//tensorflow/core:regexp_internal",
183        "@com_google_absl//absl/strings",
184    ],
185)
186
187cc_library(
188    name = "shape_inference",
189    srcs = ["shape_inference.cc"],
190    hdrs = ["shape_inference.h"],
191    deps = [
192        ":hlo",
193        "//tensorflow/compiler/xla:shape_util",
194        "//tensorflow/compiler/xla:status_macros",
195        "//tensorflow/compiler/xla:statusor",
196        "//tensorflow/compiler/xla:types",
197        "//tensorflow/compiler/xla:util",
198        "//tensorflow/compiler/xla:window_util",
199        "//tensorflow/compiler/xla:xla_data_proto",
200        "//tensorflow/core:lib",
201        "@com_google_absl//absl/algorithm:container",
202        "@com_google_absl//absl/container:flat_hash_set",
203        "@com_google_absl//absl/strings",
204        "@com_google_absl//absl/strings:str_format",
205        "@com_google_absl//absl/types:span",
206    ],
207)
208
209tf_cc_test(
210    name = "shape_inference_test",
211    srcs = ["shape_inference_test.cc"],
212    deps = [
213        ":hlo",
214        ":shape_inference",
215        "//tensorflow/compiler/xla:shape_util",
216        "//tensorflow/compiler/xla:test",
217        "//tensorflow/compiler/xla:test_helpers",
218        "//tensorflow/compiler/xla:types",
219        "//tensorflow/compiler/xla:xla_data_proto",
220        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
221        "//tensorflow/core:lib",
222        "@com_google_absl//absl/types:span",
223    ],
224)
225
226tf_cc_test(
227    name = "hlo_opcode_test",
228    srcs = ["hlo_opcode_test.cc"],
229    deps = [
230        ":hlo",
231        "//tensorflow/compiler/xla:test",
232        "//tensorflow/compiler/xla:types",
233        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
234    ],
235)
236
237cc_library(
238    name = "hlo_evaluator",
239    srcs = [
240        "hlo_evaluator.cc",
241        "hlo_evaluator_typed_visitor.h",
242        "hlo_evaluator_typed_visitor_bfloat16.cc",
243        "hlo_evaluator_typed_visitor_bool.cc",
244        "hlo_evaluator_typed_visitor_complex128.cc",
245        "hlo_evaluator_typed_visitor_complex64.cc",
246        "hlo_evaluator_typed_visitor_double.cc",
247        "hlo_evaluator_typed_visitor_float.cc",
248        "hlo_evaluator_typed_visitor_half.cc",
249        "hlo_evaluator_typed_visitor_int16.cc",
250        "hlo_evaluator_typed_visitor_int32.cc",
251        "hlo_evaluator_typed_visitor_int64.cc",
252        "hlo_evaluator_typed_visitor_int8.cc",
253        "hlo_evaluator_typed_visitor_uint16.cc",
254        "hlo_evaluator_typed_visitor_uint32.cc",
255        "hlo_evaluator_typed_visitor_uint64.cc",
256        "hlo_evaluator_typed_visitor_uint8.cc",
257    ],
258    hdrs = ["hlo_evaluator.h"],
259    deps = [
260        ":dynamic_dimension_inference",
261        ":hlo",
262        ":hlo_casting_utils",
263        ":hlo_query",
264        ":shape_inference",
265        "//tensorflow/compiler/xla:array2d",
266        "//tensorflow/compiler/xla:literal",
267        "//tensorflow/compiler/xla:literal_util",
268        "//tensorflow/compiler/xla:shape_util",
269        "//tensorflow/compiler/xla:statusor",
270        "//tensorflow/compiler/xla:types",
271        "//tensorflow/compiler/xla:util",
272        "//tensorflow/compiler/xla:window_util",
273        "//tensorflow/compiler/xla:xla_data_proto",
274        "//tensorflow/compiler/xla/service/cpu:runtime_single_threaded_matmul",
275        "//tensorflow/core:lib",
276        "@com_google_absl//absl/algorithm:container",
277        "@com_google_absl//absl/base",
278        "@com_google_absl//absl/container:inlined_vector",
279        "@com_google_absl//absl/container:node_hash_map",
280        "@com_google_absl//absl/memory",
281        "@com_google_absl//absl/meta:type_traits",
282        "@com_google_absl//absl/strings",
283        "@com_google_absl//absl/types:optional",
284        "@com_google_absl//absl/types:span",
285    ],
286)
287
288tf_cc_test(
289    name = "hlo_evaluator_test",
290    srcs = ["hlo_evaluator_test.cc"],
291    deps = [
292        ":hlo",
293        ":hlo_element_type_converter",
294        ":hlo_evaluator",
295        "//tensorflow/compiler/xla:literal",
296        "//tensorflow/compiler/xla:reference_util",
297        "//tensorflow/compiler/xla:shape_util",
298        "//tensorflow/compiler/xla:status",
299        "//tensorflow/compiler/xla:status_macros",
300        "//tensorflow/compiler/xla:statusor",
301        "//tensorflow/compiler/xla:test",
302        "//tensorflow/compiler/xla:types",
303        "//tensorflow/compiler/xla:util",
304        "//tensorflow/compiler/xla:xla_data_proto",
305        "//tensorflow/compiler/xla/client:xla_builder",
306        "//tensorflow/compiler/xla/tests:hlo_test_base",
307        "//tensorflow/compiler/xla/tests:literal_test_util",
308        "//tensorflow/compiler/xla/tests:test_utils",
309        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
310        "//tensorflow/core:lib",
311        "//tensorflow/core:test",
312        "@com_google_absl//absl/memory",
313        "@com_google_absl//absl/strings:str_format",
314    ],
315)
316
317cc_library(
318    name = "hlo",
319    srcs = [
320        "dfs_hlo_visitor.cc",
321        "dynamic_parameter_binding.cc",
322        "hlo_computation.cc",
323        "hlo_input_output_alias_config.cc",
324        "hlo_instruction.cc",
325        "hlo_instructions.cc",
326        "hlo_module.cc",
327        "hlo_opcode.cc",
328        "hlo_schedule.cc",
329        "hlo_sharding.cc",
330        "hlo_sharding_metadata.cc",
331    ],
332    hdrs = [
333        "dfs_hlo_visitor.h",
334        "dfs_hlo_visitor_with_default.h",
335        "dynamic_parameter_binding.h",
336        "hlo_clone_context.h",
337        "hlo_computation.h",
338        "hlo_domain_metadata.h",
339        "hlo_input_output_alias_config.h",
340        "hlo_instruction.h",
341        "hlo_instructions.h",
342        "hlo_module.h",
343        "hlo_opcode.h",
344        "hlo_schedule.h",
345        "hlo_sharding.h",
346        "hlo_sharding_metadata.h",
347    ],
348    deps = [
349        ":hlo_casting_utils",
350        ":hlo_module_config",
351        ":hlo_proto",
352        ":name_uniquer",
353        "//tensorflow/compiler/xla:array",
354        "//tensorflow/compiler/xla:comparison_util",
355        "//tensorflow/compiler/xla:literal",
356        "//tensorflow/compiler/xla:literal_util",
357        "//tensorflow/compiler/xla:protobuf_util",
358        "//tensorflow/compiler/xla:shape_tree",
359        "//tensorflow/compiler/xla:shape_util",
360        "//tensorflow/compiler/xla:status",
361        "//tensorflow/compiler/xla:status_macros",
362        "//tensorflow/compiler/xla:statusor",
363        "//tensorflow/compiler/xla:types",
364        "//tensorflow/compiler/xla:util",
365        "//tensorflow/compiler/xla:window_util",
366        "//tensorflow/compiler/xla:xla_data_proto",
367        "//tensorflow/core:human_readable_json",
368        "//tensorflow/core:lib",
369        "//tensorflow/core:lib_internal",
370        "@com_google_absl//absl/algorithm:container",
371        "@com_google_absl//absl/container:flat_hash_map",
372        "@com_google_absl//absl/container:flat_hash_set",
373        "@com_google_absl//absl/container:inlined_vector",
374        "@com_google_absl//absl/memory",
375        "@com_google_absl//absl/strings",
376        "@com_google_absl//absl/strings:str_format",
377        "@com_google_absl//absl/types:optional",
378        "@com_google_absl//absl/types:span",
379    ],
380)
381
382tf_cc_test(
383    name = "dynamic_parameter_binding_test",
384    srcs = ["dynamic_parameter_binding_test.cc"],
385    deps = [
386        ":hlo",
387        ":hlo_dce",
388        ":hlo_memory_scheduler",
389        ":hlo_ordering",
390        ":hlo_parser",
391        "//tensorflow/compiler/xla:shape_util",
392        "//tensorflow/compiler/xla:types",
393        "//tensorflow/compiler/xla:xla_data_proto",
394        "//tensorflow/compiler/xla/tests:hlo_test_base",
395        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
396        "//tensorflow/core:test",
397        "@com_google_absl//absl/algorithm:container",
398    ],
399)
400
401tf_cc_test(
402    name = "dfs_hlo_visitor_with_default_test",
403    srcs = ["dfs_hlo_visitor_with_default_test.cc"],
404    deps = [
405        ":hlo",
406        ":hlo_runner",
407        "//tensorflow/compiler/xla:shape_util",
408        "//tensorflow/compiler/xla:test",
409        "//tensorflow/compiler/xla:test_helpers",
410        "//tensorflow/compiler/xla:util",
411        "//tensorflow/compiler/xla:xla_data_proto",
412        "//tensorflow/compiler/xla/tests:hlo_test_base",
413        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
414        "//tensorflow/core:test",
415    ],
416)
417
418cc_library(
419    name = "pattern_matcher",
420    hdrs = ["pattern_matcher.h"],
421    deps = [
422        ":hlo",
423        ":hlo_casting_utils",
424        "//tensorflow/compiler/xla:literal_util",
425        "//tensorflow/compiler/xla:shape_util",
426        "@com_google_absl//absl/strings",
427        "@com_google_absl//absl/utility",
428    ],
429)
430
431tf_cc_test(
432    name = "pattern_matcher_test",
433    srcs = ["pattern_matcher_test.cc"],
434    deps = [
435        ":hlo",
436        ":pattern_matcher",
437        "//tensorflow/compiler/xla:shape_util",
438        "//tensorflow/compiler/xla:test",
439        "//tensorflow/compiler/xla/service:hlo_parser",
440        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
441        "//tensorflow/core:test",
442        "@com_google_absl//absl/strings",
443    ],
444)
445
446cc_library(
447    name = "pattern_matcher_gmock",
448    testonly = 1,
449    hdrs = ["pattern_matcher_gmock.h"],
450    deps = [
451        ":pattern_matcher",
452        "//tensorflow/compiler/xla:test",
453        "//tensorflow/core:test",
454    ],
455)
456
457tf_cc_test(
458    name = "pattern_matcher_gmock_test",
459    srcs = ["pattern_matcher_gmock_test.cc"],
460    deps = [
461        ":hlo",
462        ":pattern_matcher",
463        ":pattern_matcher_gmock",
464        "//tensorflow/compiler/xla:shape_util",
465        "//tensorflow/compiler/xla:test",
466        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
467        "//tensorflow/core:test",
468    ],
469)
470
471cc_library(
472    name = "hlo_reachability",
473    srcs = ["hlo_reachability.cc"],
474    hdrs = ["hlo_reachability.h"],
475    deps = [
476        ":hlo",
477        "//tensorflow/compiler/xla:types",
478        "//tensorflow/compiler/xla:util",
479        "//tensorflow/core:lib",
480        "//tensorflow/core:lib_internal",
481        "@com_google_absl//absl/base",
482        "@com_google_absl//absl/container:flat_hash_map",
483        "@com_google_absl//absl/types:span",
484    ],
485)
486
487tf_cc_test(
488    name = "hlo_reachability_test",
489    srcs = ["hlo_reachability_test.cc"],
490    deps = [
491        ":hlo",
492        ":hlo_reachability",
493        "//tensorflow/compiler/xla:test",
494        "//tensorflow/compiler/xla:test_helpers",
495        "//tensorflow/compiler/xla/tests:hlo_test_base",
496        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
497    ],
498)
499
500cc_library(
501    name = "hlo_matchers",
502    testonly = 1,
503    srcs = ["hlo_matchers.cc"],
504    hdrs = ["hlo_matchers.h"],
505    deps = [
506        ":hlo",
507        "//tensorflow/compiler/xla:test",
508        "//tensorflow/compiler/xla/service:hlo_parser",
509        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
510        "@com_google_absl//absl/strings",
511        "@com_google_absl//absl/types:optional",
512    ],
513)
514
515tf_cc_test(
516    name = "hlo_matchers_test",
517    srcs = ["hlo_matchers_test.cc"],
518    deps = [
519        ":hlo_matchers",
520        ":hlo_parser",
521        "//tensorflow/compiler/xla:literal_util",
522        "//tensorflow/compiler/xla:shape_util",
523        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
524    ],
525)
526
527tf_cc_test(
528    name = "hlo_instruction_test",
529    srcs = ["hlo_instruction_test.cc"],
530    deps = [
531        ":hlo",
532        ":hlo_parser",
533        "//tensorflow/compiler/xla:literal",
534        "//tensorflow/compiler/xla:protobuf_util",
535        "//tensorflow/compiler/xla:shape_util",
536        "//tensorflow/compiler/xla:test",
537        "//tensorflow/compiler/xla:test_helpers",
538        "//tensorflow/compiler/xla:util",
539        "//tensorflow/compiler/xla:window_util",
540        "//tensorflow/compiler/xla/tests:hlo_test_base",
541        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
542        "@com_google_absl//absl/container:flat_hash_map",
543    ],
544)
545
546tf_cc_test(
547    name = "hlo_sharding_test",
548    srcs = ["hlo_sharding_test.cc"],
549    deps = [
550        ":hlo",
551        "//tensorflow/compiler/xla:literal",
552        "//tensorflow/compiler/xla:protobuf_util",
553        "//tensorflow/compiler/xla:shape_util",
554        "//tensorflow/compiler/xla:test",
555        "//tensorflow/compiler/xla:test_helpers",
556        "//tensorflow/compiler/xla:util",
557        "//tensorflow/compiler/xla/service:hlo_parser",
558        "//tensorflow/compiler/xla/tests:hlo_test_base",
559        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
560    ],
561)
562
563cc_library(
564    name = "call_graph",
565    srcs = ["call_graph.cc"],
566    hdrs = ["call_graph.h"],
567    deps = [
568        ":hlo",
569        "//tensorflow/compiler/xla:status_macros",
570        "//tensorflow/compiler/xla:util",
571        "//tensorflow/core:lib",
572        "@com_google_absl//absl/container:flat_hash_map",
573        "@com_google_absl//absl/container:flat_hash_set",
574        "@com_google_absl//absl/memory",
575        "@com_google_absl//absl/strings",
576        "@com_google_absl//absl/strings:str_format",
577    ],
578)
579
580tf_cc_test(
581    name = "call_graph_test",
582    srcs = ["call_graph_test.cc"],
583    deps = [
584        ":call_graph",
585        "//tensorflow/compiler/xla:literal",
586        "//tensorflow/compiler/xla:shape_util",
587        "//tensorflow/compiler/xla:status_macros",
588        "//tensorflow/compiler/xla:test",
589        "//tensorflow/compiler/xla:test_helpers",
590        "//tensorflow/compiler/xla:util",
591        "//tensorflow/compiler/xla:xla_data_proto",
592        "//tensorflow/compiler/xla/service:hlo",
593        "//tensorflow/compiler/xla/tests:hlo_test_base",
594        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
595        "//tensorflow/core:test",
596    ],
597)
598
599cc_library(
600    name = "flatten_call_graph",
601    srcs = ["flatten_call_graph.cc"],
602    hdrs = ["flatten_call_graph.h"],
603    deps = [
604        ":call_graph",
605        ":hlo",
606        ":hlo_pass",
607        "//tensorflow/compiler/xla:statusor",
608        "//tensorflow/compiler/xla:util",
609        "//tensorflow/core:lib",
610    ],
611)
612
613cc_library(
614    name = "call_inliner",
615    srcs = ["call_inliner.cc"],
616    hdrs = ["call_inliner.h"],
617    deps = [
618        ":call_graph",
619        ":hlo_dce",
620        ":hlo_pass",
621        "//tensorflow/compiler/xla:statusor",
622        "//tensorflow/core:lib",
623    ],
624)
625
626tf_cc_test(
627    name = "call_inliner_test",
628    size = "small",
629    srcs = ["call_inliner_test.cc"],
630    deps = [
631        ":call_inliner",
632        ":hlo",
633        ":hlo_matchers",
634        ":hlo_pass",
635        "//tensorflow/compiler/xla:literal",
636        "//tensorflow/compiler/xla:shape_util",
637        "//tensorflow/compiler/xla:test",
638        "//tensorflow/compiler/xla:types",
639        "//tensorflow/compiler/xla:util",
640        "//tensorflow/compiler/xla:xla_data_proto",
641        "//tensorflow/compiler/xla/tests:hlo_test_base",
642        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
643        "//tensorflow/core:lib",
644        "//tensorflow/core:test",
645        "@com_google_absl//absl/memory",
646    ],
647)
648
649tf_cc_test(
650    name = "flatten_call_graph_test",
651    srcs = ["flatten_call_graph_test.cc"],
652    deps = [
653        ":call_graph",
654        ":flatten_call_graph",
655        "//tensorflow/compiler/xla:literal",
656        "//tensorflow/compiler/xla:shape_util",
657        "//tensorflow/compiler/xla:status_macros",
658        "//tensorflow/compiler/xla:test",
659        "//tensorflow/compiler/xla:test_helpers",
660        "//tensorflow/compiler/xla:util",
661        "//tensorflow/compiler/xla:xla_data_proto",
662        "//tensorflow/compiler/xla/service:hlo",
663        "//tensorflow/compiler/xla/tests:hlo_test_base",
664        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
665        "//tensorflow/core:test",
666    ],
667)
668
669cc_library(
670    name = "platform_util",
671    srcs = ["platform_util.cc"],
672    hdrs = ["platform_util.h"],
673    deps = [
674        ":compiler",
675        "//tensorflow/compiler/xla:debug_options_flags",
676        "//tensorflow/compiler/xla:status_macros",
677        "//tensorflow/compiler/xla:statusor",
678        "//tensorflow/compiler/xla:types",
679        "//tensorflow/compiler/xla:util",
680        "//tensorflow/core:lib",
681        "//tensorflow/core:stream_executor_no_cuda",
682        "@com_google_absl//absl/strings",
683    ],
684)
685
686cc_library(
687    name = "backend",
688    srcs = ["backend.cc"],
689    hdrs = ["backend.h"],
690    deps = [
691        ":compiler",
692        ":computation_placer",
693        ":device_memory_allocator",
694        ":platform_util",
695        ":stream_pool",
696        ":transfer_manager",
697        "//tensorflow/compiler/xla:status_macros",
698        "//tensorflow/compiler/xla:statusor",
699        "//tensorflow/compiler/xla:types",
700        "//tensorflow/compiler/xla:util",
701        "//tensorflow/core:lib",
702        "//tensorflow/core:stream_executor_no_cuda",
703        "//third_party/eigen3",
704        "@com_google_absl//absl/container:flat_hash_map",
705        "@com_google_absl//absl/memory",
706        "@com_google_absl//absl/strings",
707        "@com_google_absl//absl/types:span",
708    ],
709)
710
711cc_library(
712    name = "service",
713    srcs = ["service.cc"],
714    hdrs = ["service.h"],
715    deps = [
716        ":allocation_tracker",
717        ":backend",
718        ":channel_tracker",
719        ":compilation_cache",
720        ":compiler",
721        ":computation_layout",
722        ":computation_placer",
723        ":device_memory_allocator",
724        ":dump",
725        ":dynamic_dimension_inference",
726        ":executable",
727        ":execution_tracker",
728        ":hlo",
729        ":hlo_cost_analysis",
730        ":hlo_evaluator",
731        ":hlo_execution_profile",
732        ":hlo_module_config",
733        ":hlo_proto_util",
734        ":platform_util",
735        ":source_map_util",
736        ":stream_pool",
737        ":transfer_manager",
738        "//tensorflow/compiler/xla:debug_options_flags",
739        "//tensorflow/compiler/xla:executable_run_options",
740        "//tensorflow/compiler/xla:execution_options_util",
741        "//tensorflow/compiler/xla:service_interface",
742        "//tensorflow/compiler/xla:shape_layout",
743        "//tensorflow/compiler/xla:shape_util",
744        "//tensorflow/compiler/xla:status_macros",
745        "//tensorflow/compiler/xla:statusor",
746        "//tensorflow/compiler/xla:types",
747        "//tensorflow/compiler/xla:util",
748        "//tensorflow/compiler/xla:xla_data_proto",
749        "//tensorflow/compiler/xla:xla_proto",
750        "//tensorflow/core:lib",
751        "//tensorflow/core:ptr_util",
752        "//tensorflow/core:stream_executor_no_cuda",
753        "@com_google_absl//absl/memory",
754        "@com_google_absl//absl/strings",
755        "@com_google_absl//absl/strings:str_format",
756        "@com_google_absl//absl/types:span",
757    ],
758    alwayslink = 1,
759)
760
761cc_library(
762    name = "local_service",
763    srcs = ["local_service.cc"],
764    hdrs = ["local_service.h"],
765    deps = [
766        ":backend",
767        ":compiler",
768        ":computation_layout",
769        ":device_memory_allocator",
770        ":executable",
771        ":hlo",
772        ":hlo_execution_profile",
773        ":hlo_module_config",
774        ":platform_util",
775        ":service",
776        ":shaped_buffer",
777        "//tensorflow/compiler/xla:execution_options_util",
778        "//tensorflow/compiler/xla:shape_layout",
779        "//tensorflow/compiler/xla:shape_util",
780        "//tensorflow/compiler/xla:status_macros",
781        "//tensorflow/compiler/xla:statusor",
782        "//tensorflow/compiler/xla:types",
783        "//tensorflow/compiler/xla:util",
784        "//tensorflow/compiler/xla:xla_data_proto",
785        "//tensorflow/compiler/xla/client:executable_build_options",
786        "//tensorflow/compiler/xla/client:xla_computation",
787        "//tensorflow/core:lib",
788        "//tensorflow/core:stream_executor_no_cuda",
789        "@com_google_absl//absl/memory",
790        "@com_google_absl//absl/strings",
791        "@com_google_absl//absl/strings:str_format",
792        "@com_google_absl//absl/types:span",
793    ],
794)
795
796cc_library(
797    name = "compile_only_service",
798    srcs = ["compile_only_service.cc"],
799    hdrs = ["compile_only_service.h"],
800    deps = [
801        ":backend",
802        ":compiler",
803        ":computation_layout",
804        ":dump",
805        ":platform_util",
806        ":service",
807        "//tensorflow/compiler/xla:debug_options_flags",
808        "//tensorflow/compiler/xla:status_macros",
809        "//tensorflow/compiler/xla:statusor",
810        "//tensorflow/compiler/xla:types",
811        "//tensorflow/compiler/xla:util",
812        "//tensorflow/compiler/xla:xla_data_proto",
813        "//tensorflow/core:lib",
814        "//tensorflow/core:lib_internal",
815        "//tensorflow/core:stream_executor_no_cuda",
816        "@com_google_absl//absl/strings",
817    ],
818)
819
820cc_library(
821    name = "cpu_plugin",
822    deps = [
823        ":service",
824        "//tensorflow/compiler/xla/service/cpu:cpu_compiler",
825        "//tensorflow/compiler/xla/service/cpu:cpu_transfer_manager",
826        "//tensorflow/core:stream_executor_no_cuda",
827    ],
828)
829
830cc_library(
831    name = "gpu_plugin",
832    deps = [
833        ":service",
834        "//tensorflow/compiler/xla/service/gpu:gpu_transfer_manager",
835        "//tensorflow/compiler/xla/service/gpu:nvptx_compiler",
836        "//tensorflow/core:stream_executor_no_cuda",
837        "//tensorflow/core/platform/default/build_config:stream_executor_cuda",
838    ],
839)
840
841cc_library(
842    name = "interpreter_plugin",
843    deps = [
844        ":service",
845        "//tensorflow/compiler/xla/service/interpreter:compiler",
846        "//tensorflow/compiler/xla/service/interpreter:interpreter_transfer_manager",
847        "//tensorflow/compiler/xla/service/interpreter:platform",
848        "//tensorflow/core:stream_executor_no_cuda",
849    ],
850)
851
852cc_library(
853    name = "shaped_buffer",
854    srcs = ["shaped_buffer.cc"],
855    hdrs = ["shaped_buffer.h"],
856    deps = [
857        ":device_memory_allocator",
858        "//tensorflow/compiler/xla:shape_tree",
859        "//tensorflow/compiler/xla:shape_util",
860        "//tensorflow/compiler/xla:status_macros",
861        "//tensorflow/compiler/xla:statusor",
862        "//tensorflow/compiler/xla:types",
863        "//tensorflow/compiler/xla:util",
864        "//tensorflow/compiler/xla:xla_data_proto",
865        "//tensorflow/core:lib",
866        "//tensorflow/core:stream_executor_no_cuda",
867        "@com_google_absl//absl/container:flat_hash_set",
868        "@com_google_absl//absl/memory",
869        "@com_google_absl//absl/strings",
870        "@com_google_absl//absl/strings:str_format",
871        "@com_google_absl//absl/types:span",
872    ],
873)
874
875tf_cc_test(
876    name = "shaped_buffer_test",
877    srcs = ["shaped_buffer_test.cc"],
878    deps = [
879        ":cpu_plugin",
880        ":device_memory_allocator",
881        ":platform_util",
882        ":shaped_buffer",
883        "//tensorflow/compiler/xla:shape_util",
884        "//tensorflow/compiler/xla:test",
885        "//tensorflow/compiler/xla:test_helpers",
886        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
887        "//tensorflow/core:ptr_util",
888        "//tensorflow/core:stream_executor_no_cuda",
889        "//tensorflow/core:test",
890        "@com_google_absl//absl/memory",
891    ],
892)
893
894cc_library(
895    name = "executable",
896    srcs = ["executable.cc"],
897    hdrs = [
898        "executable.h",
899        "service_executable_run_options.h",
900    ],
901    deps = [
902        ":computation_layout",
903        ":device_memory_allocator",
904        ":dump",
905        ":hlo",
906        ":hlo_execution_profile",
907        ":hlo_graph_dumper",
908        ":hlo_proto",
909        ":maybe_owning_device_memory",
910        ":shaped_buffer",
911        ":stream_pool",
912        "//tensorflow/compiler/xla:debug_options_flags",
913        "//tensorflow/compiler/xla:executable_run_options",
914        "//tensorflow/compiler/xla:shape_tree",
915        "//tensorflow/compiler/xla:status",
916        "//tensorflow/compiler/xla:status_macros",
917        "//tensorflow/compiler/xla:statusor",
918        "//tensorflow/compiler/xla:util",
919        "//tensorflow/compiler/xla:xla_data_proto",
920        "//tensorflow/core:lib",
921        "//tensorflow/core:lib_internal",
922        "//tensorflow/core:stream_executor_no_cuda",
923        "//tensorflow/stream_executor",
924        "@com_google_absl//absl/memory",
925        "@com_google_absl//absl/strings:str_format",
926        "@com_google_absl//absl/types:span",
927        "@com_google_absl//absl/types:variant",
928    ],
929)
930
931cc_library(
932    name = "compiler",
933    srcs = ["compiler.cc"],
934    hdrs = ["compiler.h"],
935    deps = [
936        ":buffer_value",
937        ":computation_placer",
938        ":executable",
939        ":hlo",
940        ":hlo_module_config",
941        ":hlo_module_group",
942        ":logical_buffer",
943        "//tensorflow/compiler/xla:statusor",
944        "//tensorflow/compiler/xla:types",
945        "//tensorflow/compiler/xla:util",
946        "//tensorflow/core:lib",
947        "//tensorflow/core:stream_executor_no_cuda",
948        "@com_google_absl//absl/types:span",
949    ],
950)
951
952cc_library(
953    name = "llvm_compiler",
954    srcs = ["llvm_compiler.cc"],
955    hdrs = ["llvm_compiler.h"],
956    deps = [
957        ":compiler",
958        "//tensorflow/core:lib_internal",
959        "@llvm//:core",
960    ],
961)
962
963cc_library(
964    name = "transfer_manager",
965    srcs = ["transfer_manager.cc"],
966    hdrs = ["transfer_manager.h"],
967    deps = [
968        ":shaped_buffer",
969        "//tensorflow/compiler/xla:literal",
970        "//tensorflow/compiler/xla:shape_util",
971        "//tensorflow/compiler/xla:status_macros",
972        "//tensorflow/compiler/xla:statusor",
973        "//tensorflow/compiler/xla:types",
974        "//tensorflow/compiler/xla:util",
975        "//tensorflow/compiler/xla:xla_data_proto",
976        "//tensorflow/core:lib",
977        "//tensorflow/core:stream_executor_no_cuda",
978        "@com_google_absl//absl/memory",
979        "@com_google_absl//absl/strings",
980        "@com_google_absl//absl/types:span",
981    ],
982)
983
984cc_library(
985    name = "allocation_tracker",
986    srcs = ["allocation_tracker.cc"],
987    hdrs = ["allocation_tracker.h"],
988    deps = [
989        ":backend",
990        ":device_memory_allocator",
991        ":transfer_manager",
992        "//tensorflow/compiler/xla:shape_util",
993        "//tensorflow/compiler/xla:status_macros",
994        "//tensorflow/compiler/xla:statusor",
995        "//tensorflow/compiler/xla:types",
996        "//tensorflow/compiler/xla:util",
997        "//tensorflow/compiler/xla:xla_data_proto",
998        "//tensorflow/core:lib",
999        "@com_google_absl//absl/container:flat_hash_map",
1000        "@com_google_absl//absl/memory",
1001        "@com_google_absl//absl/strings",
1002    ],
1003)
1004
1005cc_library(
1006    name = "execution_tracker",
1007    srcs = ["execution_tracker.cc"],
1008    hdrs = ["execution_tracker.h"],
1009    deps = [
1010        ":backend",
1011        ":stream_pool",
1012        "//tensorflow/compiler/xla:executable_run_options",
1013        "//tensorflow/compiler/xla:statusor",
1014        "//tensorflow/compiler/xla:util",
1015        "//tensorflow/compiler/xla:xla_data_proto",
1016        "//tensorflow/core:lib",
1017        "//tensorflow/core:stream_executor_no_cuda",
1018        "@com_google_absl//absl/memory",
1019    ],
1020)
1021
1022cc_library(
1023    name = "channel_tracker",
1024    srcs = ["channel_tracker.cc"],
1025    hdrs = ["channel_tracker.h"],
1026    deps = [
1027        ":hlo",
1028        "//tensorflow/compiler/xla:status",
1029        "//tensorflow/compiler/xla:status_macros",
1030        "//tensorflow/compiler/xla:statusor",
1031        "//tensorflow/compiler/xla:types",
1032        "//tensorflow/compiler/xla:util",
1033        "//tensorflow/compiler/xla:xla_data_proto",
1034        "//tensorflow/core:lib",
1035        "//tensorflow/core:lib_internal",
1036        "@com_google_absl//absl/container:flat_hash_map",
1037        "@com_google_absl//absl/memory",
1038        "@com_google_absl//absl/strings",
1039        "@com_google_absl//absl/types:span",
1040    ],
1041)
1042
1043cc_library(
1044    name = "name_uniquer",
1045    srcs = ["name_uniquer.cc"],
1046    hdrs = ["name_uniquer.h"],
1047    deps = [
1048        "//tensorflow/compiler/xla:shape_util",
1049        "//tensorflow/compiler/xla:types",
1050        "//tensorflow/core:lib",
1051        "@com_google_absl//absl/container:flat_hash_map",
1052        "@com_google_absl//absl/container:flat_hash_set",
1053        "@com_google_absl//absl/strings",
1054    ],
1055)
1056
1057tf_cc_test(
1058    name = "name_uniquer_test",
1059    srcs = ["name_uniquer_test.cc"],
1060    deps = [
1061        ":name_uniquer",
1062        "//tensorflow/compiler/xla:test",
1063        "//tensorflow/compiler/xla:test_helpers",
1064        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1065        "//tensorflow/core:test",
1066    ],
1067)
1068
1069cc_library(
1070    name = "buffer_liveness",
1071    srcs = [
1072        "buffer_liveness.cc",
1073    ],
1074    hdrs = [
1075        "buffer_liveness.h",
1076    ],
1077    deps = [
1078        ":hlo",
1079        ":hlo_ordering",
1080        ":logical_buffer",
1081        ":tuple_points_to_analysis",
1082        "//tensorflow/compiler/xla:shape_util",
1083        "//tensorflow/compiler/xla:status_macros",
1084        "//tensorflow/compiler/xla:statusor",
1085        "//tensorflow/compiler/xla:types",
1086        "//tensorflow/compiler/xla:util",
1087        "//tensorflow/core:lib",
1088        "@com_google_absl//absl/container:flat_hash_set",
1089        "@com_google_absl//absl/strings",
1090        "@com_google_absl//absl/strings:str_format",
1091    ],
1092)
1093
1094tf_cc_test(
1095    name = "buffer_liveness_test",
1096    srcs = ["buffer_liveness_test.cc"],
1097    deps = [
1098        ":buffer_liveness",
1099        ":hlo",
1100        ":hlo_dataflow_analysis",
1101        "//tensorflow/compiler/xla:shape_util",
1102        "//tensorflow/compiler/xla:types",
1103        "//tensorflow/compiler/xla:util",
1104        "//tensorflow/compiler/xla:xla_data_proto",
1105        "//tensorflow/compiler/xla/tests:hlo_test_base",
1106        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1107        "//tensorflow/core:test",
1108        "@com_google_absl//absl/memory",
1109    ],
1110)
1111
1112cc_library(
1113    name = "buffer_assignment",
1114    srcs = [
1115        "buffer_assignment.cc",
1116    ],
1117    hdrs = [
1118        "buffer_assignment.h",
1119    ],
1120    deps = [
1121        ":buffer_liveness",
1122        ":buffer_value_containers",
1123        ":heap_simulator",
1124        ":hlo",
1125        ":hlo_proto",
1126        ":logical_buffer",
1127        ":tuple_points_to_analysis",
1128        "//tensorflow/compiler/xla:shape_util",
1129        "//tensorflow/compiler/xla:status_macros",
1130        "//tensorflow/compiler/xla:statusor",
1131        "//tensorflow/compiler/xla:types",
1132        "//tensorflow/compiler/xla:util",
1133        "//tensorflow/core:lib",
1134        "//tensorflow/core:lib_internal",
1135        "@com_google_absl//absl/container:flat_hash_map",
1136        "@com_google_absl//absl/container:flat_hash_set",
1137        "@com_google_absl//absl/memory",
1138        "@com_google_absl//absl/strings",
1139        "@com_google_absl//absl/strings:str_format",
1140        "@com_google_absl//absl/types:span",
1141    ],
1142)
1143
1144tf_cc_test(
1145    name = "buffer_assignment_test",
1146    srcs = ["buffer_assignment_test.cc"],
1147    deps = [
1148        ":buffer_assignment",
1149        ":buffer_value",
1150        ":call_graph",
1151        ":copy_insertion",
1152        ":cpu_plugin",
1153        ":flatten_call_graph",
1154        ":hlo",
1155        ":hlo_memory_scheduler",
1156        ":hlo_ordering",
1157        "//tensorflow/compiler/xla:literal",
1158        "//tensorflow/compiler/xla:shape_util",
1159        "//tensorflow/compiler/xla:test",
1160        "//tensorflow/compiler/xla:test_helpers",
1161        "//tensorflow/compiler/xla:types",
1162        "//tensorflow/compiler/xla:util",
1163        "//tensorflow/compiler/xla:xla_data_proto",
1164        "//tensorflow/compiler/xla/service:hlo_parser",
1165        "//tensorflow/compiler/xla/tests:hlo_test_base",
1166        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1167        "//tensorflow/core:lib",
1168        "//tensorflow/core:test",
1169        "@com_google_absl//absl/container:flat_hash_set",
1170        "@com_google_absl//absl/memory",
1171    ],
1172)
1173
1174cc_library(
1175    name = "hlo_ordering",
1176    srcs = ["hlo_ordering.cc"],
1177    hdrs = ["hlo_ordering.h"],
1178    deps = [
1179        ":call_graph",
1180        ":hlo",
1181        ":hlo_dataflow_analysis",
1182        ":hlo_proto",
1183        ":hlo_reachability",
1184        ":hlo_value",
1185        "//tensorflow/compiler/xla:shape_util",
1186        "//tensorflow/compiler/xla:status_macros",
1187        "//tensorflow/compiler/xla:statusor",
1188        "//tensorflow/compiler/xla:types",
1189        "//tensorflow/compiler/xla:util",
1190        "//tensorflow/core:lib",
1191        "@com_google_absl//absl/container:flat_hash_map",
1192        "@com_google_absl//absl/strings",
1193        "@com_google_absl//absl/strings:str_format",
1194    ],
1195)
1196
1197tf_cc_test(
1198    name = "hlo_ordering_test",
1199    size = "small",
1200    srcs = ["hlo_ordering_test.cc"],
1201    deps = [
1202        ":hlo",
1203        ":hlo_dataflow_analysis",
1204        ":hlo_memory_scheduler",
1205        ":hlo_ordering",
1206        "//tensorflow/compiler/xla:shape_util",
1207        "//tensorflow/compiler/xla:types",
1208        "//tensorflow/compiler/xla:xla_data_proto",
1209        "//tensorflow/compiler/xla/service:hlo_parser",
1210        "//tensorflow/compiler/xla/tests:hlo_test_base",
1211        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1212        "//tensorflow/core:test",
1213    ],
1214)
1215
1216cc_library(
1217    name = "heap_simulator",
1218    srcs = ["heap_simulator.cc"],
1219    hdrs = ["heap_simulator.h"],
1220    deps = [
1221        ":buffer_value",
1222        ":buffer_value_containers",
1223        ":hlo",
1224        ":hlo_ordering",
1225        ":hlo_proto",
1226        ":tuple_points_to_analysis",
1227        "//tensorflow/compiler/xla:statusor",
1228        "//tensorflow/compiler/xla:util",
1229        "@com_google_absl//absl/container:flat_hash_map",
1230        "@com_google_absl//absl/container:flat_hash_set",
1231        "@com_google_absl//absl/memory",
1232    ],
1233)
1234
1235tf_cc_test(
1236    name = "heap_simulator_test",
1237    srcs = ["heap_simulator_test.cc"],
1238    deps = [
1239        ":buffer_value",
1240        ":heap_simulator",
1241        ":hlo",
1242        ":hlo_ordering",
1243        ":hlo_value",
1244        ":tuple_points_to_analysis",
1245        "//tensorflow/compiler/xla:literal",
1246        "//tensorflow/compiler/xla:status_macros",
1247        "//tensorflow/compiler/xla/tests:hlo_test_base",
1248        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1249        "//tensorflow/core:lib",
1250        "//tensorflow/core:test",
1251        "@com_google_absl//absl/container:flat_hash_map",
1252        "@com_google_absl//absl/memory",
1253    ],
1254)
1255
1256cc_library(
1257    name = "hlo_module_group",
1258    srcs = ["hlo_module_group.cc"],
1259    hdrs = ["hlo_module_group.h"],
1260    deps = [
1261        ":hlo",
1262        ":hlo_proto",
1263        "@com_google_absl//absl/strings",
1264        "@com_google_absl//absl/types:span",
1265    ],
1266)
1267
1268tf_cc_test(
1269    name = "hlo_module_group_test",
1270    srcs = ["hlo_module_group_test.cc"],
1271    deps = [
1272        ":hlo",
1273        ":hlo_matchers",
1274        ":hlo_module_group",
1275        ":hlo_module_group_metadata",
1276        ":hlo_parser",
1277        ":hlo_proto",
1278        "//tensorflow/compiler/xla:test",
1279        "//tensorflow/compiler/xla:util",
1280        "//tensorflow/compiler/xla/tests:hlo_test_base",
1281        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1282        "//tensorflow/core:lib",
1283        "//tensorflow/core:test",
1284    ],
1285)
1286
1287cc_library(
1288    name = "hlo_module_group_metadata",
1289    srcs = ["hlo_module_group_metadata.cc"],
1290    hdrs = ["hlo_module_group_metadata.h"],
1291    deps = [
1292        ":hlo",
1293        ":hlo_casting_utils",
1294        ":tuple_points_to_analysis",
1295        "//tensorflow/compiler/xla:shape_util",
1296        "//tensorflow/compiler/xla:status",
1297        "//tensorflow/compiler/xla:status_macros",
1298        "//tensorflow/compiler/xla:statusor",
1299        "//tensorflow/compiler/xla:util",
1300        "//tensorflow/core:lib",
1301        "@com_google_absl//absl/container:flat_hash_map",
1302        "@com_google_absl//absl/memory",
1303        "@com_google_absl//absl/types:optional",
1304    ],
1305)
1306
1307cc_library(
1308    name = "hlo_module_group_util",
1309    srcs = ["hlo_module_group_util.cc"],
1310    hdrs = ["hlo_module_group_util.h"],
1311    deps = [
1312        ":hlo",
1313        ":hlo_casting_utils",
1314        ":hlo_module_group_metadata",
1315        ":hlo_reachability",
1316        "//tensorflow/compiler/xla:status",
1317        "//tensorflow/compiler/xla:status_macros",
1318        "//tensorflow/compiler/xla:statusor",
1319        "//tensorflow/compiler/xla:types",
1320        "//tensorflow/compiler/xla:util",
1321        "//tensorflow/core:lib",
1322        "@com_google_absl//absl/container:flat_hash_map",
1323        "@com_google_absl//absl/container:flat_hash_set",
1324        "@com_google_absl//absl/memory",
1325        "@com_google_absl//absl/strings",
1326        "@com_google_absl//absl/types:span",
1327    ],
1328)
1329
1330tf_cc_test(
1331    name = "hlo_schedule_test",
1332    srcs = ["hlo_schedule_test.cc"],
1333    deps = [
1334        ":heap_simulator",
1335        ":hlo",
1336        ":hlo_dce",
1337        ":hlo_memory_scheduler",
1338        ":hlo_ordering",
1339        ":hlo_parser",
1340        "//tensorflow/compiler/xla:shape_util",
1341        "//tensorflow/compiler/xla:types",
1342        "//tensorflow/compiler/xla:xla_data_proto",
1343        "//tensorflow/compiler/xla/tests:hlo_test_base",
1344        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1345        "//tensorflow/core:test",
1346        "@com_google_absl//absl/algorithm:container",
1347    ],
1348)
1349
1350tf_cc_test(
1351    name = "hlo_input_output_alias_config_test",
1352    srcs = ["hlo_input_output_alias_config_test.cc"],
1353    deps = [
1354        ":hlo",
1355        ":hlo_dce",
1356        ":hlo_memory_scheduler",
1357        ":hlo_ordering",
1358        ":hlo_parser",
1359        "//tensorflow/compiler/xla:shape_util",
1360        "//tensorflow/compiler/xla:types",
1361        "//tensorflow/compiler/xla:xla_data_proto",
1362        "//tensorflow/compiler/xla/tests:hlo_test_base",
1363        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1364        "//tensorflow/core:test",
1365        "@com_google_absl//absl/algorithm:container",
1366    ],
1367)
1368
1369cc_library(
1370    name = "hlo_memory_scheduler",
1371    srcs = ["hlo_memory_scheduler.cc"],
1372    hdrs = ["hlo_memory_scheduler.h"],
1373    deps = [
1374        ":heap_simulator",
1375        ":hlo",
1376        ":hlo_casting_utils",
1377        ":hlo_ordering",
1378        ":hlo_pass",
1379        ":logical_buffer",
1380        ":tuple_points_to_analysis",
1381        "//tensorflow/compiler/xla:shape_util",
1382        "//tensorflow/compiler/xla:status_macros",
1383        "//tensorflow/compiler/xla:statusor",
1384        "//tensorflow/compiler/xla:types",
1385        "//tensorflow/compiler/xla:util",
1386        "//tensorflow/core:lib",
1387        "//tensorflow/core:lib_internal",
1388        "@com_google_absl//absl/container:flat_hash_map",
1389        "@com_google_absl//absl/container:flat_hash_set",
1390    ],
1391)
1392
1393tf_cc_test(
1394    name = "hlo_memory_scheduler_test",
1395    srcs = ["hlo_memory_scheduler_test.cc"],
1396    deps = [
1397        ":heap_simulator",
1398        ":hlo",
1399        ":hlo_dce",
1400        ":hlo_memory_scheduler",
1401        ":hlo_ordering",
1402        ":hlo_parser",
1403        "//tensorflow/compiler/xla:shape_util",
1404        "//tensorflow/compiler/xla:types",
1405        "//tensorflow/compiler/xla:xla_data_proto",
1406        "//tensorflow/compiler/xla/tests:hlo_test_base",
1407        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1408        "//tensorflow/core:test",
1409        "@com_google_absl//absl/algorithm:container",
1410        "@com_google_absl//absl/container:flat_hash_map",
1411    ],
1412)
1413
1414cc_library(
1415    name = "hlo_query",
1416    srcs = ["hlo_query.cc"],
1417    hdrs = ["hlo_query.h"],
1418    deps = [
1419        ":hlo",
1420        "//tensorflow/compiler/xla:literal",
1421        "//tensorflow/compiler/xla:shape_util",
1422        "@com_google_absl//absl/container:flat_hash_set",
1423    ],
1424)
1425
1426cc_library(
1427    name = "fusion_queue",
1428    hdrs = ["fusion_queue.h"],
1429    deps = [
1430        ":hlo",
1431    ],
1432)
1433
1434cc_library(
1435    name = "instruction_fusion",
1436    srcs = ["instruction_fusion.cc"],
1437    hdrs = ["instruction_fusion.h"],
1438    deps = [
1439        ":fusion_queue",
1440        ":hlo",
1441        ":hlo_pass",
1442        ":hlo_reachability",
1443        "//tensorflow/compiler/xla:util",
1444        "//tensorflow/core:lib",
1445        "@com_google_absl//absl/algorithm:container",
1446        "@com_google_absl//absl/container:flat_hash_map",
1447        "@com_google_absl//absl/container:flat_hash_set",
1448        "@com_google_absl//absl/memory",
1449    ],
1450)
1451
1452tf_cc_test(
1453    name = "instruction_fusion_test",
1454    srcs = ["instruction_fusion_test.cc"],
1455    deps = [
1456        ":hlo_matchers",
1457        ":instruction_fusion",
1458        "//tensorflow/compiler/xla/service:hlo_parser",
1459        "//tensorflow/compiler/xla/tests:hlo_test_base",
1460        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1461    ],
1462)
1463
1464cc_library(
1465    name = "multi_output_fusion",
1466    srcs = ["multi_output_fusion.cc"],
1467    hdrs = ["multi_output_fusion.h"],
1468    deps = [
1469        ":hlo_reachability",
1470        "//tensorflow/compiler/xla:shape_util",
1471        "//tensorflow/compiler/xla:statusor",
1472        "//tensorflow/compiler/xla/service:hlo",
1473        "//tensorflow/compiler/xla/service:hlo_pass",
1474        "//tensorflow/core:lib",
1475        "@com_google_absl//absl/container:flat_hash_map",
1476        "@com_google_absl//absl/container:flat_hash_set",
1477        "@com_google_absl//absl/strings",
1478    ],
1479)
1480
1481cc_library(
1482    name = "hlo_creation_utils",
1483    srcs = ["hlo_creation_utils.cc"],
1484    hdrs = ["hlo_creation_utils.h"],
1485    deps = [
1486        ":hlo",
1487        ":hlo_module_config",
1488        ":shape_inference",
1489        "//tensorflow/compiler/xla:literal",
1490        "//tensorflow/compiler/xla:literal_util",
1491        "//tensorflow/compiler/xla:statusor",
1492        "//tensorflow/compiler/xla:util",
1493        "//tensorflow/compiler/xla/client:xla_builder",
1494        "//tensorflow/compiler/xla/client:xla_computation",
1495        "//tensorflow/compiler/xla/client/lib:comparators",
1496        "@com_google_absl//absl/algorithm:container",
1497        "@com_google_absl//absl/memory",
1498        "@com_google_absl//absl/strings",
1499    ],
1500)
1501
1502tf_cc_test(
1503    name = "hlo_creation_utils_test",
1504    srcs = ["hlo_creation_utils_test.cc"],
1505    deps = [
1506        ":hlo",
1507        ":hlo_creation_utils",
1508        ":hlo_evaluator",
1509        ":hlo_matchers",
1510        "//tensorflow/compiler/xla:shape_util",
1511        "//tensorflow/compiler/xla:test",
1512        "//tensorflow/compiler/xla:util",
1513        "//tensorflow/compiler/xla/tests:hlo_test_base",
1514        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1515        "//tensorflow/core:test",
1516        "@com_google_absl//absl/memory",
1517    ],
1518)
1519
1520cc_library(
1521    name = "batchnorm_expander",
1522    srcs = ["batchnorm_expander.cc"],
1523    hdrs = ["batchnorm_expander.h"],
1524    deps = [
1525        ":hlo",
1526        ":hlo_pass",
1527        "//tensorflow/compiler/xla:literal",
1528        "//tensorflow/compiler/xla:literal_util",
1529        "//tensorflow/compiler/xla:shape_util",
1530        "//tensorflow/compiler/xla:status_macros",
1531        "//tensorflow/compiler/xla:types",
1532        "//tensorflow/compiler/xla:util",
1533        "//tensorflow/compiler/xla:xla_data_proto",
1534        "//tensorflow/core:lib",
1535        "@com_google_absl//absl/types:optional",
1536        "@com_google_absl//absl/types:span",
1537    ],
1538)
1539
1540cc_library(
1541    name = "op_expander_pass",
1542    srcs = ["op_expander_pass.cc"],
1543    hdrs = ["op_expander_pass.h"],
1544    deps = [
1545        ":hlo",
1546        ":hlo_creation_utils",
1547        ":hlo_pass",
1548        "//tensorflow/compiler/xla:statusor",
1549        "//tensorflow/compiler/xla:util",
1550        "@com_google_absl//absl/algorithm:container",
1551    ],
1552)
1553
1554cc_library(
1555    name = "gather_expander",
1556    srcs = ["gather_expander.cc"],
1557    hdrs = ["gather_expander.h"],
1558    deps = [
1559        ":hlo",
1560        ":hlo_creation_utils",
1561        ":hlo_pass",
1562        ":op_expander_pass",
1563        ":while_util",
1564        "//tensorflow/compiler/xla:literal_util",
1565        "//tensorflow/compiler/xla:statusor",
1566        "//tensorflow/compiler/xla:util",
1567        "@com_google_absl//absl/algorithm:container",
1568    ],
1569)
1570
1571cc_library(
1572    name = "scatter_expander",
1573    srcs = ["scatter_expander.cc"],
1574    hdrs = ["scatter_expander.h"],
1575    deps = [
1576        ":hlo",
1577        ":hlo_creation_utils",
1578        ":hlo_pass",
1579        ":while_util",
1580        "//tensorflow/compiler/xla:literal_util",
1581        "//tensorflow/compiler/xla:statusor",
1582        "@com_google_absl//absl/algorithm:container",
1583    ],
1584)
1585
1586cc_library(
1587    name = "triangular_solve_expander",
1588    srcs = ["triangular_solve_expander.cc"],
1589    hdrs = ["triangular_solve_expander.h"],
1590    deps = [
1591        ":op_expander_pass",
1592        "//tensorflow/compiler/xla:literal",
1593        "//tensorflow/compiler/xla:shape_util",
1594        "//tensorflow/compiler/xla:status_macros",
1595        "//tensorflow/compiler/xla:statusor",
1596        "//tensorflow/compiler/xla:util",
1597        "//tensorflow/compiler/xla/client:xla_builder",
1598        "//tensorflow/compiler/xla/client:xla_computation",
1599        "//tensorflow/compiler/xla/client/lib:constants",
1600        "//tensorflow/compiler/xla/client/lib:math",
1601        "//tensorflow/compiler/xla/client/lib:matrix",
1602        "//tensorflow/compiler/xla/client/lib:slicing",
1603        "//tensorflow/core:lib",
1604        "@com_google_absl//absl/container:flat_hash_map",
1605    ],
1606)
1607
1608cc_library(
1609    name = "cholesky_expander",
1610    srcs = ["cholesky_expander.cc"],
1611    hdrs = ["cholesky_expander.h"],
1612    deps = [
1613        ":op_expander_pass",
1614        "//tensorflow/compiler/xla:literal",
1615        "//tensorflow/compiler/xla:shape_util",
1616        "//tensorflow/compiler/xla:status_macros",
1617        "//tensorflow/compiler/xla:statusor",
1618        "//tensorflow/compiler/xla:util",
1619        "//tensorflow/compiler/xla/client:xla_builder",
1620        "//tensorflow/compiler/xla/client:xla_computation",
1621        "//tensorflow/compiler/xla/client/lib:constants",
1622        "//tensorflow/compiler/xla/client/lib:loops",
1623        "//tensorflow/compiler/xla/client/lib:math",
1624        "//tensorflow/compiler/xla/client/lib:matrix",
1625        "//tensorflow/compiler/xla/client/lib:slicing",
1626        "//tensorflow/core:lib",
1627        "@com_google_absl//absl/container:flat_hash_map",
1628    ],
1629)
1630
1631tf_cc_test(
1632    name = "batchnorm_expander_test",
1633    size = "small",
1634    srcs = ["batchnorm_expander_test.cc"],
1635    deps = [
1636        ":batchnorm_expander",
1637        ":hlo",
1638        ":hlo_matchers",
1639        ":hlo_parser",
1640        ":hlo_pass",
1641        "//tensorflow/compiler/xla:literal",
1642        "//tensorflow/compiler/xla:shape_util",
1643        "//tensorflow/compiler/xla:test",
1644        "//tensorflow/compiler/xla:types",
1645        "//tensorflow/compiler/xla:util",
1646        "//tensorflow/compiler/xla:xla_data_proto",
1647        "//tensorflow/compiler/xla/tests:hlo_test_base",
1648        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1649        "//tensorflow/core:lib",
1650        "@com_google_absl//absl/memory",
1651    ],
1652)
1653
1654cc_library(
1655    name = "algebraic_simplifier",
1656    srcs = ["algebraic_simplifier.cc"],
1657    hdrs = ["algebraic_simplifier.h"],
1658    deps = [
1659        ":hlo",
1660        ":hlo_casting_utils",
1661        ":hlo_creation_utils",
1662        ":hlo_pass",
1663        ":hlo_query",
1664        ":pattern_matcher",
1665        "//tensorflow/compiler/xla:literal",
1666        "//tensorflow/compiler/xla:literal_util",
1667        "//tensorflow/compiler/xla:shape_util",
1668        "//tensorflow/compiler/xla:status_macros",
1669        "//tensorflow/compiler/xla:types",
1670        "//tensorflow/compiler/xla:util",
1671        "//tensorflow/compiler/xla:window_util",
1672        "//tensorflow/compiler/xla:xla_data_proto",
1673        "//tensorflow/core:lib",
1674        "@com_google_absl//absl/algorithm:container",
1675        "@com_google_absl//absl/container:flat_hash_map",
1676        "@com_google_absl//absl/container:flat_hash_set",
1677        "@com_google_absl//absl/container:inlined_vector",
1678        "@com_google_absl//absl/memory",
1679        "@com_google_absl//absl/strings",
1680        "@com_google_absl//absl/types:optional",
1681        "@com_google_absl//absl/types:span",
1682    ],
1683)
1684
1685tf_cc_test(
1686    name = "algebraic_simplifier_test",
1687    srcs = ["algebraic_simplifier_test.cc"],
1688    deps = [
1689        ":algebraic_simplifier",
1690        ":hlo",
1691        ":hlo_casting_utils",
1692        ":hlo_creation_utils",
1693        ":hlo_parser",
1694        ":hlo_pass",
1695        ":pattern_matcher",
1696        ":pattern_matcher_gmock",
1697        "//tensorflow/compiler/xla:literal",
1698        "//tensorflow/compiler/xla:shape_util",
1699        "//tensorflow/compiler/xla:test",
1700        "//tensorflow/compiler/xla:types",
1701        "//tensorflow/compiler/xla:util",
1702        "//tensorflow/compiler/xla:window_util",
1703        "//tensorflow/compiler/xla:xla_data_proto",
1704        "//tensorflow/compiler/xla/tests:hlo_test_base",
1705        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
1706        "//tensorflow/core:lib",
1707        "//tensorflow/core:test",
1708        "@com_google_absl//absl/memory",
1709        "@com_google_absl//absl/strings",
1710    ],
1711)
1712
1713cc_library(
1714    name = "batch_dot_simplification",
1715    srcs = ["batch_dot_simplification.cc"],
1716    hdrs = ["batch_dot_simplification.h"],
1717    deps = [
1718        ":hlo",
1719        ":hlo_creation_utils",
1720        ":hlo_pass",
1721        "@com_google_absl//absl/algorithm:container",
1722    ],
1723)
1724
1725tf_cc_test(
1726    name = "batch_dot_simplification_test",
1727    srcs = ["batch_dot_simplification_test.cc"],
1728    deps = [
1729        ":batch_dot_simplification",
1730        ":hlo",
1731        ":hlo_matchers",
1732        ":hlo_pass",
1733        "//tensorflow/compiler/xla:literal",
1734        "//tensorflow/compiler/xla:shape_util",
1735        "//tensorflow/compiler/xla:test",
1736        "//tensorflow/compiler/xla:types",
1737        "//tensorflow/compiler/xla:util",
1738        "//tensorflow/compiler/xla:window_util",
1739        "//tensorflow/compiler/xla:xla_data_proto",
1740        "//tensorflow/compiler/xla/tests:hlo_test_base",
1741        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
1742        "//tensorflow/core:lib",
1743        "//tensorflow/core:test",
1744    ],
1745)
1746
1747tf_cc_test(
1748    name = "gather_expander_test",
1749    srcs = ["gather_expander_test.cc"],
1750    deps = [
1751        ":gather_expander",
1752        "//tensorflow/compiler/xla:test",
1753        "//tensorflow/compiler/xla/service:hlo_parser",
1754        "//tensorflow/compiler/xla/tests:test_macros_header",
1755        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
1756    ],
1757)
1758
1759cc_library(
1760    name = "conditional_simplifier",
1761    srcs = ["conditional_simplifier.cc"],
1762    hdrs = ["conditional_simplifier.h"],
1763    deps = [
1764        ":call_inliner",
1765        ":hlo",
1766        ":hlo_pass",
1767        "//tensorflow/compiler/xla:literal",
1768        "//tensorflow/compiler/xla:status_macros",
1769        "//tensorflow/compiler/xla:statusor",
1770        "//tensorflow/compiler/xla:types",
1771        "//tensorflow/compiler/xla:util",
1772        "//tensorflow/core:lib",
1773        "@com_google_absl//absl/strings",
1774    ],
1775)
1776
1777tf_cc_test(
1778    name = "conditional_simplifier_test",
1779    srcs = ["conditional_simplifier_test.cc"],
1780    deps = [
1781        ":conditional_simplifier",
1782        ":hlo",
1783        ":hlo_matchers",
1784        "//tensorflow/compiler/xla:literal",
1785        "//tensorflow/compiler/xla:literal_util",
1786        "//tensorflow/compiler/xla:shape_util",
1787        "//tensorflow/compiler/xla:test",
1788        "//tensorflow/compiler/xla:types",
1789        "//tensorflow/compiler/xla:xla_data_proto",
1790        "//tensorflow/compiler/xla/tests:hlo_test_base",
1791        "//tensorflow/core:lib",
1792        "//tensorflow/core:test",
1793    ],
1794)
1795
1796cc_library(
1797    name = "convolution_group_converter",
1798    srcs = ["convolution_group_converter.cc"],
1799    hdrs = ["convolution_group_converter.h"],
1800    deps = [
1801        ":hlo",
1802        ":hlo_pass",
1803        "//tensorflow/compiler/xla:literal",
1804        "//tensorflow/compiler/xla:literal_util",
1805        "//tensorflow/compiler/xla:shape_util",
1806        "//tensorflow/compiler/xla:status_macros",
1807        "//tensorflow/compiler/xla:types",
1808        "//tensorflow/compiler/xla:util",
1809        "//tensorflow/compiler/xla:xla_data_proto",
1810        "//tensorflow/core:lib",
1811        "@com_google_absl//absl/memory",
1812        "@com_google_absl//absl/strings",
1813    ],
1814)
1815
1816tf_cc_test(
1817    name = "convolution_group_converter_test",
1818    size = "small",
1819    srcs = ["convolution_group_converter_test.cc"],
1820    deps = [
1821        ":convolution_group_converter",
1822        ":hlo",
1823        ":hlo_matchers",
1824        ":hlo_parser",
1825        "//tensorflow/compiler/xla:test",
1826        "//tensorflow/compiler/xla:types",
1827        "//tensorflow/compiler/xla/tests:hlo_test_base",
1828    ],
1829)
1830
1831cc_library(
1832    name = "while_loop_analysis",
1833    srcs = ["while_loop_analysis.cc"],
1834    hdrs = ["while_loop_analysis.h"],
1835    deps = [
1836        ":hlo",
1837        ":hlo_evaluator",
1838        ":pattern_matcher",
1839        "@com_google_absl//absl/base",
1840        "@com_google_absl//absl/types:optional",
1841    ],
1842)
1843
1844tf_cc_test(
1845    name = "while_loop_analysis_test",
1846    srcs = ["while_loop_analysis_test.cc"],
1847    deps = [
1848        ":while_loop_analysis",
1849        "//tensorflow/compiler/xla:test",
1850        "//tensorflow/compiler/xla/service:hlo_parser",
1851        "//tensorflow/compiler/xla/tests:hlo_test_base",
1852        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
1853        "//tensorflow/core:test",
1854    ],
1855)
1856
1857cc_library(
1858    name = "while_loop_simplifier",
1859    srcs = ["while_loop_simplifier.cc"],
1860    hdrs = ["while_loop_simplifier.h"],
1861    deps = [
1862        ":call_inliner",
1863        ":hlo",
1864        ":hlo_pass",
1865        ":hlo_query",
1866        ":pattern_matcher",
1867        ":while_loop_analysis",
1868        "//tensorflow/compiler/xla:shape_util",
1869        "//tensorflow/compiler/xla:statusor",
1870        "@com_google_absl//absl/container:flat_hash_map",
1871        "@com_google_absl//absl/container:flat_hash_set",
1872        "@com_google_absl//absl/strings",
1873        "@com_google_absl//absl/types:optional",
1874    ],
1875)
1876
1877tf_cc_test(
1878    name = "while_loop_simplifier_test",
1879    srcs = ["while_loop_simplifier_test.cc"],
1880    deps = [
1881        ":algebraic_simplifier",
1882        ":hlo",
1883        ":hlo_cse",
1884        ":hlo_dce",
1885        ":hlo_matchers",
1886        ":hlo_parser",
1887        ":hlo_pass",
1888        ":hlo_pass_pipeline",
1889        ":tuple_simplifier",
1890        ":while_loop_simplifier",
1891        "//tensorflow/compiler/xla:test",
1892        "//tensorflow/compiler/xla/tests:hlo_test_base",
1893        "//tensorflow/core:lib",
1894        "//tensorflow/core:test",
1895        "@com_google_absl//absl/strings",
1896    ],
1897)
1898
1899cc_library(
1900    name = "while_loop_trip_count_annotator",
1901    srcs = ["while_loop_trip_count_annotator.cc"],
1902    hdrs = ["while_loop_trip_count_annotator.h"],
1903    deps = [
1904        ":hlo",
1905        ":hlo_pass",
1906        ":while_loop_analysis",
1907        "//tensorflow/compiler/xla:statusor",
1908        "//tensorflow/compiler/xla:xla_data_proto",
1909    ],
1910)
1911
1912tf_cc_test(
1913    name = "while_loop_trip_count_annotator_test",
1914    srcs = ["while_loop_trip_count_annotator_test.cc"],
1915    deps = [
1916        ":pattern_matcher",
1917        ":while_loop_simplifier",
1918        ":while_loop_trip_count_annotator",
1919        "//tensorflow/compiler/xla:literal",
1920        "//tensorflow/compiler/xla:shape_util",
1921        "//tensorflow/compiler/xla:status_macros",
1922        "//tensorflow/compiler/xla:test",
1923        "//tensorflow/compiler/xla/tests:hlo_test_base",
1924        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
1925        "//tensorflow/core:test",
1926    ],
1927)
1928
1929cc_library(
1930    name = "defuser",
1931    srcs = ["defuser.cc"],
1932    hdrs = ["defuser.h"],
1933    deps = [
1934        ":call_graph",
1935        ":hlo",
1936        ":hlo_pass",
1937        "//tensorflow/compiler/xla:status_macros",
1938        "//tensorflow/compiler/xla:types",
1939        "//tensorflow/compiler/xla:util",
1940        "//tensorflow/core:lib",
1941        "@com_google_absl//absl/container:flat_hash_map",
1942    ],
1943)
1944
1945tf_cc_test(
1946    name = "defuser_test",
1947    srcs = ["defuser_test.cc"],
1948    deps = [
1949        ":defuser",
1950        ":hlo_matchers",
1951        "//tensorflow/compiler/xla:literal",
1952        "//tensorflow/compiler/xla:shape_util",
1953        "//tensorflow/compiler/xla/tests:hlo_test_base",
1954    ],
1955)
1956
1957cc_library(
1958    name = "dot_decomposer",
1959    srcs = ["dot_decomposer.cc"],
1960    hdrs = ["dot_decomposer.h"],
1961    deps = [
1962        ":hlo",
1963        ":hlo_pass",
1964        "//tensorflow/compiler/xla:shape_util",
1965        "//tensorflow/compiler/xla:status_macros",
1966        "//tensorflow/compiler/xla:types",
1967        "//tensorflow/core:lib",
1968        "@com_google_absl//absl/algorithm:container",
1969        "@com_google_absl//absl/strings",
1970    ],
1971)
1972
1973cc_library(
1974    name = "tuple_simplifier",
1975    srcs = ["tuple_simplifier.cc"],
1976    hdrs = ["tuple_simplifier.h"],
1977    deps = [
1978        ":hlo",
1979        ":hlo_pass",
1980        "//tensorflow/compiler/xla:status_macros",
1981        "//tensorflow/compiler/xla:types",
1982        "//tensorflow/compiler/xla:util",
1983        "//tensorflow/core:lib",
1984    ],
1985)
1986
1987tf_cc_test(
1988    name = "tuple_simplifier_test",
1989    srcs = ["tuple_simplifier_test.cc"],
1990    deps = [
1991        ":hlo",
1992        ":hlo_matchers",
1993        ":tuple_simplifier",
1994        "//tensorflow/compiler/xla:literal",
1995        "//tensorflow/compiler/xla:shape_util",
1996        "//tensorflow/compiler/xla:test",
1997        "//tensorflow/compiler/xla:types",
1998        "//tensorflow/compiler/xla/tests:hlo_test_base",
1999        "//tensorflow/core:test",
2000    ],
2001)
2002
2003cc_library(
2004    name = "reshape_mover",
2005    srcs = ["reshape_mover.cc"],
2006    hdrs = ["reshape_mover.h"],
2007    deps = [
2008        ":hlo_pass",
2009        "//tensorflow/compiler/xla:literal",
2010        "//tensorflow/compiler/xla:shape_util",
2011        "//tensorflow/compiler/xla:status_macros",
2012        "//tensorflow/compiler/xla:util",
2013        "//tensorflow/core:lib",
2014        "@com_google_absl//absl/algorithm:container",
2015    ],
2016)
2017
2018cc_library(
2019    name = "dynamic_dimension_inference",
2020    srcs = ["dynamic_dimension_inference.cc"],
2021    hdrs = ["dynamic_dimension_inference.h"],
2022    deps = [
2023        ":hlo",
2024        ":while_util",
2025        "//tensorflow/compiler/xla:status",
2026        "//tensorflow/compiler/xla:statusor",
2027        "//tensorflow/compiler/xla:types",
2028        "//tensorflow/compiler/xla:window_util",
2029        "//tensorflow/core:lib",
2030        "@com_google_absl//absl/container:flat_hash_map",
2031        "@com_google_absl//absl/types:span",
2032    ],
2033)
2034
2035cc_library(
2036    name = "dynamic_padder",
2037    srcs = ["dynamic_padder.cc"],
2038    hdrs = ["dynamic_padder.h"],
2039    deps = [
2040        ":dynamic_dimension_inference",
2041        ":hlo_dce",
2042        ":hlo_pass",
2043        "//tensorflow/compiler/xla:literal",
2044        "//tensorflow/compiler/xla:literal_util",
2045        "//tensorflow/compiler/xla:shape_util",
2046        "//tensorflow/compiler/xla:status_macros",
2047        "//tensorflow/compiler/xla:util",
2048        "//tensorflow/core:lib",
2049        "@com_google_absl//absl/algorithm:container",
2050        "@com_google_absl//absl/container:flat_hash_map",
2051        "@com_google_absl//absl/container:flat_hash_set",
2052    ],
2053)
2054
2055tf_cc_test(
2056    name = "dynamic_padder_test",
2057    srcs = ["dynamic_padder_test.cc"],
2058    deps = [
2059        ":dynamic_padder",
2060        ":hlo",
2061        ":hlo_matchers",
2062        ":hlo_parser",
2063        ":hlo_runner",
2064        "//tensorflow/compiler/xla:debug_options_flags",
2065        "//tensorflow/compiler/xla:literal",
2066        "//tensorflow/compiler/xla:shape_util",
2067        "//tensorflow/compiler/xla:status_macros",
2068        "//tensorflow/compiler/xla:test",
2069        "//tensorflow/compiler/xla:test_helpers",
2070        "//tensorflow/compiler/xla:xla_data_proto",
2071        "//tensorflow/compiler/xla/client:xla_builder",
2072        "//tensorflow/compiler/xla/tests:hlo_test_base",
2073        "//tensorflow/core:test",
2074    ],
2075)
2076
2077tf_cc_test(
2078    name = "dynamic_dimension_inference_test",
2079    srcs = ["dynamic_dimension_inference_test.cc"],
2080    deps = [
2081        ":dynamic_dimension_inference",
2082        ":hlo",
2083        ":hlo_matchers",
2084        ":hlo_runner",
2085        "//tensorflow/compiler/xla:debug_options_flags",
2086        "//tensorflow/compiler/xla:literal",
2087        "//tensorflow/compiler/xla:shape_util",
2088        "//tensorflow/compiler/xla:test",
2089        "//tensorflow/compiler/xla:test_helpers",
2090        "//tensorflow/compiler/xla:xla_data_proto",
2091        "//tensorflow/compiler/xla/client:xla_builder",
2092        "//tensorflow/compiler/xla/tests:hlo_test_base",
2093        "//tensorflow/core:test",
2094    ],
2095)
2096
2097tf_cc_test(
2098    name = "reshape_mover_test",
2099    srcs = ["reshape_mover_test.cc"],
2100    deps = [
2101        ":hlo",
2102        ":hlo_matchers",
2103        ":reshape_mover",
2104        "//tensorflow/compiler/xla:literal",
2105        "//tensorflow/compiler/xla:shape_util",
2106        "//tensorflow/compiler/xla:test",
2107        "//tensorflow/compiler/xla:test_helpers",
2108        "//tensorflow/compiler/xla:types",
2109        "//tensorflow/compiler/xla:util",
2110        "//tensorflow/compiler/xla:xla_data_proto",
2111        "//tensorflow/compiler/xla/tests:hlo_test_base",
2112        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2113        "//tensorflow/core:lib",
2114        "@com_google_absl//absl/memory",
2115    ],
2116)
2117
2118cc_library(
2119    name = "computation_placer",
2120    srcs = ["computation_placer.cc"],
2121    hdrs = ["computation_placer.h"],
2122    deps = [
2123        "//tensorflow/compiler/xla:array2d",
2124        "//tensorflow/compiler/xla:literal",
2125        "//tensorflow/compiler/xla:shape_util",
2126        "//tensorflow/compiler/xla:status",
2127        "//tensorflow/compiler/xla:status_macros",
2128        "//tensorflow/compiler/xla:statusor",
2129        "//tensorflow/compiler/xla:types",
2130        "//tensorflow/compiler/xla:util",
2131        "//tensorflow/compiler/xla:xla_data_proto",
2132        "//tensorflow/core:lib",
2133        "//tensorflow/core:stream_executor_no_cuda",
2134        "@com_google_absl//absl/memory",
2135        "@com_google_absl//absl/strings",
2136    ],
2137    alwayslink = True,  # Contains per-platform computation placer registration
2138)
2139
2140cc_library(
2141    name = "human_readable_profile_builder",
2142    srcs = ["human_readable_profile_builder.cc"],
2143    hdrs = ["human_readable_profile_builder.h"],
2144    deps = [
2145        "//tensorflow/compiler/xla:metric_table_report",
2146        "//tensorflow/compiler/xla:types",
2147        "//tensorflow/compiler/xla:util",
2148        "//tensorflow/core:lib",
2149        "@com_google_absl//absl/strings",
2150        "@com_google_absl//absl/strings:str_format",
2151    ],
2152)
2153
2154cc_library(
2155    name = "generic_transfer_manager",
2156    srcs = ["generic_transfer_manager.cc"],
2157    hdrs = ["generic_transfer_manager.h"],
2158    deps = [
2159        ":transfer_manager",
2160        "//tensorflow/compiler/xla:literal",
2161        "//tensorflow/compiler/xla:shape_util",
2162        "//tensorflow/compiler/xla:status_macros",
2163        "//tensorflow/compiler/xla:types",
2164        "//tensorflow/compiler/xla:util",
2165        "//tensorflow/compiler/xla:xla_data_proto",
2166        "//tensorflow/compiler/xla/service/interpreter:platform_id",
2167        "//tensorflow/core:lib",
2168        "//tensorflow/core:stream_executor_no_cuda",
2169    ],
2170    alwayslink = True,  # Contains per-platform transfer manager registration
2171)
2172
2173cc_library(
2174    name = "hlo_cost_analysis",
2175    srcs = ["hlo_cost_analysis.cc"],
2176    hdrs = ["hlo_cost_analysis.h"],
2177    deps = [
2178        ":hlo",
2179        "//tensorflow/compiler/xla:shape_util",
2180        "//tensorflow/compiler/xla:status_macros",
2181        "//tensorflow/compiler/xla:statusor",
2182        "//tensorflow/compiler/xla:util",
2183        "//tensorflow/compiler/xla:window_util",
2184        "//tensorflow/compiler/xla:xla_data_proto",
2185        "//tensorflow/core:lib",
2186        "//tensorflow/core:lib_internal",
2187        "@com_google_absl//absl/types:span",
2188    ],
2189)
2190
2191tf_cc_test(
2192    name = "hlo_cost_analysis_test",
2193    srcs = ["hlo_cost_analysis_test.cc"],
2194    deps = [
2195        ":cpu_plugin",
2196        ":hlo",
2197        ":hlo_cost_analysis",
2198        ":local_service",
2199        ":service",
2200        "//tensorflow/compiler/xla:shape_util",
2201        "//tensorflow/compiler/xla:statusor",
2202        "//tensorflow/compiler/xla:test_helpers",
2203        "//tensorflow/compiler/xla:xla_data_proto",
2204        "//tensorflow/compiler/xla/client",
2205        "//tensorflow/compiler/xla/client:client_library",
2206        "//tensorflow/compiler/xla/client:local_client",
2207        "//tensorflow/compiler/xla/client:padding",
2208        "//tensorflow/compiler/xla/client:xla_builder",
2209        "//tensorflow/compiler/xla/client:xla_computation",
2210        "//tensorflow/compiler/xla/tests:hlo_test_base",
2211        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2212        "//tensorflow/core:lib",
2213    ],
2214)
2215
2216cc_library(
2217    name = "hlo_execution_profile",
2218    srcs = ["hlo_execution_profile.cc"],
2219    hdrs = ["hlo_execution_profile.h"],
2220    deps = [
2221        ":hlo",
2222        ":hlo_cost_analysis",
2223        ":hlo_profile_printer",
2224        ":human_readable_profile_builder",
2225        "//tensorflow/compiler/xla:types",
2226        "//tensorflow/compiler/xla:util",
2227        "//tensorflow/core:lib",
2228        "//tensorflow/core:stream_executor_no_cuda",
2229        "@com_google_absl//absl/algorithm:container",
2230        "@com_google_absl//absl/memory",
2231    ],
2232)
2233
2234tf_cc_test(
2235    name = "hlo_execution_profile_test",
2236    srcs = ["hlo_execution_profile_test.cc"],
2237    deps = [
2238        ":cpu_plugin",
2239        ":hlo_cost_analysis",
2240        ":hlo_execution_profile",
2241        "//tensorflow/compiler/xla/service:hlo_parser",
2242        "//tensorflow/compiler/xla/tests:hlo_test_base",
2243        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2244        "//tensorflow/core:lib",
2245        "@com_google_absl//absl/strings",
2246    ],
2247)
2248
2249tf_cc_test(
2250    name = "hlo_computation_test",
2251    srcs = ["hlo_computation_test.cc"],
2252    deps = [
2253        ":hlo",
2254        ":pattern_matcher",
2255        ":pattern_matcher_gmock",
2256        "//tensorflow/compiler/xla:literal",
2257        "//tensorflow/compiler/xla:shape_util",
2258        "//tensorflow/compiler/xla:test",
2259        "//tensorflow/compiler/xla:test_helpers",
2260        "//tensorflow/compiler/xla/service:hlo_matchers",
2261        "//tensorflow/compiler/xla/service:hlo_parser",
2262        "//tensorflow/compiler/xla/tests:hlo_test_base",
2263        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2264        "@com_google_absl//absl/container:flat_hash_map",
2265        "@com_google_absl//absl/container:flat_hash_set",
2266    ],
2267)
2268
2269tf_cc_test(
2270    name = "hlo_module_test",
2271    srcs = ["hlo_module_test.cc"],
2272    deps = [
2273        ":hlo",
2274        ":hlo_matchers",
2275        ":hlo_memory_scheduler",
2276        ":hlo_parser",
2277        "//tensorflow/compiler/xla:literal",
2278        "//tensorflow/compiler/xla:shape_util",
2279        "//tensorflow/compiler/xla:test",
2280        "//tensorflow/compiler/xla:util",
2281        "//tensorflow/compiler/xla:xla_data_proto",
2282        "//tensorflow/compiler/xla/tests:hlo_test_base",
2283        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2284        "//tensorflow/core:lib",
2285        "//tensorflow/core:test",
2286        "@com_google_absl//absl/memory",
2287        "@com_google_absl//absl/types:span",
2288    ],
2289)
2290
2291cc_library(
2292    name = "buffer_value",
2293    srcs = ["buffer_value.cc"],
2294    hdrs = ["buffer_value.h"],
2295    deps = [
2296        ":hlo",
2297        ":hlo_proto",
2298        "//tensorflow/compiler/xla:shape_util",
2299        "//tensorflow/compiler/xla:types",
2300        "//tensorflow/compiler/xla:xla_data_proto",
2301        "//tensorflow/core:lib",
2302        "//tensorflow/core:lib_internal",
2303        "@com_google_absl//absl/strings",
2304        "@com_google_absl//absl/types:span",
2305    ],
2306)
2307
2308cc_library(
2309    name = "buffer_value_containers",
2310    hdrs = ["buffer_value_containers.h"],
2311    deps = [
2312        ":buffer_value",
2313        ":logical_buffer",
2314        "//tensorflow/core:lib",
2315        "//tensorflow/core:lib_internal",
2316        "@com_google_absl//absl/container:flat_hash_set",
2317    ],
2318)
2319
2320cc_library(
2321    name = "logical_buffer",
2322    srcs = ["logical_buffer.cc"],
2323    hdrs = ["logical_buffer.h"],
2324    deps = [
2325        ":buffer_value",
2326        ":hlo",
2327        ":hlo_proto",
2328        "//tensorflow/compiler/xla:shape_util",
2329        "//tensorflow/compiler/xla:types",
2330        "//tensorflow/compiler/xla:xla_data_proto",
2331        "//tensorflow/core:lib",
2332        "//tensorflow/core:lib_internal",
2333        "@com_google_absl//absl/strings",
2334        "@com_google_absl//absl/types:span",
2335    ],
2336)
2337
2338cc_library(
2339    name = "hlo_value",
2340    srcs = ["hlo_value.cc"],
2341    hdrs = ["hlo_value.h"],
2342    deps = [
2343        ":buffer_value",
2344        ":hlo",
2345        "//tensorflow/compiler/xla:shape_tree",
2346        "//tensorflow/compiler/xla:shape_util",
2347        "//tensorflow/compiler/xla:status",
2348        "//tensorflow/compiler/xla:types",
2349        "//tensorflow/compiler/xla:util",
2350        "//tensorflow/compiler/xla:xla_data_proto",
2351        "//tensorflow/core:lib",
2352        "@com_google_absl//absl/container:flat_hash_set",
2353        "@com_google_absl//absl/memory",
2354        "@com_google_absl//absl/strings",
2355        "@com_google_absl//absl/types:span",
2356    ],
2357)
2358
2359cc_library(
2360    name = "hlo_dataflow_analysis",
2361    srcs = ["hlo_dataflow_analysis.cc"],
2362    hdrs = ["hlo_dataflow_analysis.h"],
2363    deps = [
2364        ":call_graph",
2365        ":hlo",
2366        ":hlo_casting_utils",
2367        ":hlo_value",
2368        "//tensorflow/compiler/xla:shape_util",
2369        "//tensorflow/compiler/xla:status",
2370        "//tensorflow/compiler/xla:statusor",
2371        "//tensorflow/compiler/xla:types",
2372        "//tensorflow/compiler/xla:util",
2373        "//tensorflow/compiler/xla:xla_data_proto",
2374        "//tensorflow/core:lib",
2375        "@com_google_absl//absl/container:flat_hash_set",
2376        "@com_google_absl//absl/container:inlined_vector",
2377        "@com_google_absl//absl/memory",
2378        "@com_google_absl//absl/strings",
2379        "@com_google_absl//absl/types:span",
2380    ],
2381)
2382
2383tf_cc_test(
2384    name = "hlo_dataflow_analysis_test",
2385    srcs = ["hlo_dataflow_analysis_test.cc"],
2386    deps = [
2387        ":hlo",
2388        ":hlo_creation_utils",
2389        ":hlo_dataflow_analysis",
2390        ":hlo_graph_dumper",
2391        ":hlo_matchers",
2392        ":hlo_ordering",
2393        ":instruction_fusion",
2394        "//tensorflow/compiler/xla:literal",
2395        "//tensorflow/compiler/xla:shape_util",
2396        "//tensorflow/compiler/xla:status_macros",
2397        "//tensorflow/compiler/xla:test",
2398        "//tensorflow/compiler/xla:test_helpers",
2399        "//tensorflow/compiler/xla:xla_data_proto",
2400        "//tensorflow/compiler/xla/tests:hlo_test_base",
2401        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2402        "//tensorflow/core:lib",
2403        "//tensorflow/core:test",
2404    ],
2405)
2406
2407cc_library(
2408    name = "hlo_liveness_analysis",
2409    srcs = ["hlo_liveness_analysis.cc"],
2410    hdrs = ["hlo_liveness_analysis.h"],
2411    deps = [
2412        ":call_graph",
2413        ":hlo",
2414        ":hlo_value",
2415        "//tensorflow/compiler/xla:shape_tree",
2416        "//tensorflow/compiler/xla:shape_util",
2417        "//tensorflow/compiler/xla:status",
2418        "//tensorflow/compiler/xla:statusor",
2419        "//tensorflow/compiler/xla:types",
2420        "//tensorflow/compiler/xla:util",
2421        "//tensorflow/core:lib",
2422        "@com_google_absl//absl/container:flat_hash_set",
2423        "@com_google_absl//absl/memory",
2424        "@com_google_absl//absl/strings",
2425    ],
2426)
2427
2428tf_cc_test(
2429    name = "hlo_liveness_analysis_test",
2430    srcs = ["hlo_liveness_analysis_test.cc"],
2431    deps = [
2432        ":hlo",
2433        ":hlo_liveness_analysis",
2434        "//tensorflow/compiler/xla:literal",
2435        "//tensorflow/compiler/xla:shape_util",
2436        "//tensorflow/compiler/xla:status_macros",
2437        "//tensorflow/compiler/xla:test",
2438        "//tensorflow/compiler/xla:test_helpers",
2439        "//tensorflow/compiler/xla:xla_data_proto",
2440        "//tensorflow/compiler/xla/service:hlo_parser",
2441        "//tensorflow/compiler/xla/tests:hlo_test_base",
2442        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2443        "//tensorflow/core:lib",
2444        "//tensorflow/core:test",
2445    ],
2446)
2447
2448cc_library(
2449    name = "hlo_buffer",
2450    srcs = ["hlo_buffer.cc"],
2451    hdrs = ["hlo_buffer.h"],
2452    deps = [
2453        ":hlo",
2454        ":hlo_value",
2455        "//tensorflow/compiler/xla:shape_tree",
2456        "//tensorflow/compiler/xla:shape_util",
2457        "//tensorflow/compiler/xla:types",
2458        "//tensorflow/compiler/xla:util",
2459        "//tensorflow/compiler/xla:xla_data_proto",
2460        "//tensorflow/core:lib",
2461        "@com_google_absl//absl/container:flat_hash_set",
2462        "@com_google_absl//absl/strings",
2463    ],
2464)
2465
2466cc_library(
2467    name = "hlo_alias_analysis",
2468    srcs = ["hlo_alias_analysis.cc"],
2469    hdrs = ["hlo_alias_analysis.h"],
2470    deps = [
2471        ":hlo",
2472        ":hlo_buffer",
2473        ":hlo_dataflow_analysis",
2474        ":hlo_ordering",
2475        ":hlo_value",
2476        "//tensorflow/compiler/xla:shape_util",
2477        "//tensorflow/compiler/xla:status",
2478        "//tensorflow/compiler/xla:statusor",
2479        "//tensorflow/compiler/xla:types",
2480        "//tensorflow/compiler/xla:util",
2481        "//tensorflow/compiler/xla:xla_data_proto",
2482        "//tensorflow/core:lib",
2483        "@com_google_absl//absl/container:flat_hash_map",
2484        "@com_google_absl//absl/container:flat_hash_set",
2485        "@com_google_absl//absl/strings",
2486        "@com_google_absl//absl/types:span",
2487    ],
2488)
2489
2490tf_cc_test(
2491    name = "hlo_alias_analysis_test",
2492    srcs = ["hlo_alias_analysis_test.cc"],
2493    deps = [
2494        ":flatten_call_graph",
2495        ":hlo",
2496        ":hlo_alias_analysis",
2497        ":hlo_graph_dumper",
2498        ":hlo_matchers",
2499        ":hlo_ordering",
2500        ":instruction_fusion",
2501        "//tensorflow/compiler/xla:literal",
2502        "//tensorflow/compiler/xla:shape_util",
2503        "//tensorflow/compiler/xla:test",
2504        "//tensorflow/compiler/xla:test_helpers",
2505        "//tensorflow/compiler/xla:xla_data_proto",
2506        "//tensorflow/compiler/xla/tests:hlo_test_base",
2507        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2508        "//tensorflow/core:lib",
2509        "//tensorflow/core:test",
2510    ],
2511)
2512
2513cc_library(
2514    name = "logical_buffer_analysis",
2515    srcs = ["logical_buffer_analysis.cc"],
2516    hdrs = ["logical_buffer_analysis.h"],
2517    deps = [
2518        ":hlo",
2519        ":logical_buffer",
2520        "//tensorflow/compiler/xla:shape_util",
2521        "//tensorflow/compiler/xla:statusor",
2522        "//tensorflow/core:lib",
2523        "//tensorflow/core:lib_internal",
2524        "@com_google_absl//absl/memory",
2525    ],
2526)
2527
2528cc_library(
2529    name = "tuple_points_to_analysis",
2530    srcs = ["tuple_points_to_analysis.cc"],
2531    hdrs = ["tuple_points_to_analysis.h"],
2532    deps = [
2533        ":hlo",
2534        ":hlo_dataflow_analysis",
2535        ":logical_buffer",
2536        ":logical_buffer_analysis",
2537        "//tensorflow/compiler/xla:shape_tree",
2538        "//tensorflow/compiler/xla:shape_util",
2539        "//tensorflow/compiler/xla:statusor",
2540        "//tensorflow/compiler/xla:types",
2541        "//tensorflow/compiler/xla:util",
2542        "//tensorflow/compiler/xla:xla_data_proto",
2543        "//tensorflow/core:lib",
2544        "@com_google_absl//absl/container:flat_hash_map",
2545        "@com_google_absl//absl/container:flat_hash_set",
2546        "@com_google_absl//absl/container:inlined_vector",
2547        "@com_google_absl//absl/memory",
2548        "@com_google_absl//absl/strings",
2549        "@com_google_absl//absl/strings:str_format",
2550        "@com_google_absl//absl/types:span",
2551    ],
2552)
2553
2554tf_cc_test(
2555    name = "tuple_points_to_analysis_test",
2556    srcs = ["tuple_points_to_analysis_test.cc"],
2557    deps = [
2558        ":hlo",
2559        ":hlo_creation_utils",
2560        ":hlo_matchers",
2561        ":instruction_fusion",
2562        ":tuple_points_to_analysis",
2563        "//tensorflow/compiler/xla:literal",
2564        "//tensorflow/compiler/xla:literal_util",
2565        "//tensorflow/compiler/xla:shape_util",
2566        "//tensorflow/compiler/xla:test",
2567        "//tensorflow/compiler/xla:test_helpers",
2568        "//tensorflow/compiler/xla:xla_data_proto",
2569        "//tensorflow/compiler/xla/tests:hlo_test_base",
2570        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2571        "//tensorflow/core:lib",
2572        "//tensorflow/core:test",
2573    ],
2574)
2575
2576cc_library(
2577    name = "compilation_cache",
2578    srcs = ["compilation_cache.cc"],
2579    hdrs = ["compilation_cache.h"],
2580    deps = [
2581        ":executable",
2582        ":hlo_module_config",
2583        "//tensorflow/compiler/xla:types",
2584        "//tensorflow/compiler/xla:util",
2585        "//tensorflow/compiler/xla:xla_data_proto",
2586        "//tensorflow/core:lib",
2587        "@com_google_absl//absl/container:flat_hash_map",
2588    ],
2589)
2590
2591cc_library(
2592    name = "layout_assignment",
2593    srcs = [
2594        "layout_assignment.cc",
2595    ],
2596    hdrs = [
2597        "layout_assignment.h",
2598    ],
2599    deps = [
2600        ":computation_layout",
2601        ":hlo",
2602        ":hlo_casting_utils",
2603        ":hlo_dce",
2604        ":hlo_graph_dumper",
2605        ":hlo_pass",
2606        ":logical_buffer",
2607        ":tuple_points_to_analysis",
2608        ":tuple_simplifier",
2609        "//tensorflow/compiler/xla:shape_layout",
2610        "//tensorflow/compiler/xla:shape_util",
2611        "//tensorflow/compiler/xla:status_macros",
2612        "//tensorflow/compiler/xla:statusor",
2613        "//tensorflow/compiler/xla:types",
2614        "//tensorflow/compiler/xla:util",
2615        "//tensorflow/compiler/xla:xla_data_proto",
2616        "//tensorflow/core:lib",
2617        "@com_google_absl//absl/container:flat_hash_map",
2618        "@com_google_absl//absl/container:flat_hash_set",
2619        "@com_google_absl//absl/memory",
2620        "@com_google_absl//absl/strings",
2621        "@com_google_absl//absl/strings:str_format",
2622        "@com_google_absl//absl/types:span",
2623    ],
2624)
2625
2626cc_library(
2627    name = "copy_insertion",
2628    srcs = ["copy_insertion.cc"],
2629    hdrs = ["copy_insertion.h"],
2630    deps = [
2631        ":buffer_liveness",
2632        ":dump",
2633        ":hlo",
2634        ":hlo_alias_analysis",
2635        ":hlo_dce",
2636        ":hlo_graph_dumper",
2637        ":hlo_ordering",
2638        ":hlo_pass",
2639        ":logical_buffer",
2640        ":tuple_simplifier",
2641        "//tensorflow/compiler/xla:status_macros",
2642        "//tensorflow/compiler/xla:statusor",
2643        "//tensorflow/compiler/xla:types",
2644        "//tensorflow/compiler/xla:util",
2645        "//tensorflow/core:lib",
2646        "@com_google_absl//absl/container:flat_hash_map",
2647        "@com_google_absl//absl/container:flat_hash_set",
2648        "@com_google_absl//absl/strings",
2649    ],
2650)
2651
2652tf_cc_test(
2653    name = "copy_insertion_test",
2654    srcs = ["copy_insertion_test.cc"],
2655    deps = [
2656        ":copy_insertion",
2657        ":hlo",
2658        ":hlo_graph_dumper",
2659        ":hlo_matchers",
2660        ":hlo_runner",
2661        "//tensorflow/compiler/xla:debug_options_flags",
2662        "//tensorflow/compiler/xla:literal",
2663        "//tensorflow/compiler/xla:shape_util",
2664        "//tensorflow/compiler/xla:test",
2665        "//tensorflow/compiler/xla:test_helpers",
2666        "//tensorflow/compiler/xla:xla_data_proto",
2667        "//tensorflow/compiler/xla/tests:hlo_test_base",
2668        "//tensorflow/core:test",
2669    ],
2670)
2671
2672cc_library(
2673    name = "hlo_dce",
2674    srcs = ["hlo_dce.cc"],
2675    hdrs = ["hlo_dce.h"],
2676    deps = [
2677        ":hlo",
2678        ":hlo_pass",
2679        "//tensorflow/compiler/xla:status",
2680        "//tensorflow/compiler/xla:status_macros",
2681        "//tensorflow/compiler/xla:statusor",
2682        "//tensorflow/compiler/xla:types",
2683        "//tensorflow/compiler/xla:util",
2684        "//tensorflow/core:lib",
2685        "@com_google_absl//absl/container:flat_hash_set",
2686    ],
2687)
2688
2689cc_library(
2690    name = "hlo_module_dce",
2691    srcs = ["hlo_module_dce.cc"],
2692    hdrs = ["hlo_module_dce.h"],
2693    deps = [
2694        ":hlo",
2695        ":hlo_dce",
2696        ":hlo_liveness_analysis",
2697        ":hlo_pass",
2698        "//tensorflow/compiler/xla:status",
2699        "//tensorflow/compiler/xla:status_macros",
2700        "//tensorflow/compiler/xla:statusor",
2701        "//tensorflow/compiler/xla:types",
2702        "//tensorflow/compiler/xla:util",
2703        "//tensorflow/core:lib",
2704    ],
2705)
2706
2707cc_library(
2708    name = "hlo_verifier",
2709    srcs = ["hlo_verifier.cc"],
2710    hdrs = ["hlo_verifier.h"],
2711    deps = [
2712        ":hlo",
2713        ":hlo_casting_utils",
2714        ":hlo_pass",
2715        ":shape_inference",
2716        "//tensorflow/compiler/xla:status_macros",
2717        "//tensorflow/compiler/xla:util",
2718        "//tensorflow/core:lib",
2719        "@com_google_absl//absl/container:flat_hash_map",
2720        "@com_google_absl//absl/memory",
2721        "@com_google_absl//absl/strings",
2722    ],
2723)
2724
2725tf_cc_test(
2726    name = "hlo_verifier_test",
2727    srcs = ["hlo_verifier_test.cc"],
2728    deps = [
2729        ":hlo",
2730        ":hlo_module_config",
2731        ":hlo_parser",
2732        ":hlo_verifier",
2733        ":layout_assignment",
2734        "//tensorflow/compiler/xla:shape_util",
2735        "//tensorflow/compiler/xla:test",
2736        "//tensorflow/compiler/xla:types",
2737        "//tensorflow/compiler/xla:xla_data_proto",
2738        "//tensorflow/compiler/xla:xla_proto",
2739        "//tensorflow/compiler/xla/tests:hlo_test_base",
2740        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2741        "//tensorflow/core:test",
2742    ],
2743)
2744
2745cc_library(
2746    name = "hlo_rematerialization",
2747    srcs = ["hlo_rematerialization.cc"],
2748    hdrs = ["hlo_rematerialization.h"],
2749    deps = [
2750        ":buffer_liveness",
2751        ":buffer_value",
2752        ":call_graph",
2753        ":flatten_call_graph",
2754        ":hlo",
2755        ":hlo_dce",
2756        ":hlo_memory_scheduler",
2757        ":hlo_ordering",
2758        ":logical_buffer",
2759        ":tuple_points_to_analysis",
2760        "//tensorflow/compiler/xla:shape_util",
2761        "//tensorflow/compiler/xla:status_macros",
2762        "//tensorflow/compiler/xla:statusor",
2763        "//tensorflow/compiler/xla:types",
2764        "//tensorflow/compiler/xla:util",
2765        "//tensorflow/core:lib",
2766        "//tensorflow/core:lib_internal",
2767        "@com_google_absl//absl/container:flat_hash_map",
2768        "@com_google_absl//absl/container:flat_hash_set",
2769        "@com_google_absl//absl/container:inlined_vector",
2770        "@com_google_absl//absl/strings",
2771        "@com_google_absl//absl/strings:str_format",
2772    ],
2773)
2774
2775tf_cc_test(
2776    name = "hlo_rematerialization_test",
2777    srcs = ["hlo_rematerialization_test.cc"],
2778    deps = [
2779        ":flatten_call_graph",
2780        ":hlo",
2781        ":hlo_matchers",
2782        ":hlo_ordering",
2783        ":hlo_rematerialization",
2784        "//tensorflow/compiler/xla:shape_util",
2785        "//tensorflow/compiler/xla:types",
2786        "//tensorflow/compiler/xla:xla_data_proto",
2787        "//tensorflow/compiler/xla/tests:hlo_test_base",
2788        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2789        "//tensorflow/core:test",
2790    ],
2791)
2792
2793tf_cc_test(
2794    name = "hlo_dce_test",
2795    srcs = ["hlo_dce_test.cc"],
2796    deps = [
2797        ":hlo",
2798        ":hlo_dce",
2799        "//tensorflow/compiler/xla:literal",
2800        "//tensorflow/compiler/xla:literal_util",
2801        "//tensorflow/compiler/xla:shape_util",
2802        "//tensorflow/compiler/xla:types",
2803        "//tensorflow/compiler/xla:util",
2804        "//tensorflow/compiler/xla:xla_data_proto",
2805        "//tensorflow/compiler/xla/tests:hlo_test_base",
2806        "//tensorflow/compiler/xla/tests:literal_test_util",
2807        "//tensorflow/compiler/xla/tests:test_utils",
2808        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2809        "//tensorflow/core:lib",
2810        "//tensorflow/core:test",
2811        "@com_google_absl//absl/memory",
2812    ],
2813)
2814
2815tf_cc_test(
2816    name = "hlo_module_dce_test",
2817    srcs = ["hlo_module_dce_test.cc"],
2818    deps = [
2819        ":hlo",
2820        ":hlo_module_dce",
2821        "//tensorflow/compiler/xla:literal",
2822        "//tensorflow/compiler/xla:shape_util",
2823        "//tensorflow/compiler/xla:types",
2824        "//tensorflow/compiler/xla:util",
2825        "//tensorflow/compiler/xla:xla_data_proto",
2826        "//tensorflow/compiler/xla/service:hlo_parser",
2827        "//tensorflow/compiler/xla/tests:hlo_test_base",
2828        "//tensorflow/compiler/xla/tests:literal_test_util",
2829        "//tensorflow/compiler/xla/tests:test_utils",
2830        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2831        "//tensorflow/core:lib",
2832        "//tensorflow/core:test",
2833    ],
2834)
2835
2836tf_cc_test(
2837    name = "layout_assignment_test",
2838    srcs = ["layout_assignment_test.cc"],
2839    deps = [
2840        ":algebraic_simplifier",
2841        ":computation_layout",
2842        ":hlo",
2843        ":layout_assignment",
2844        ":pattern_matcher",
2845        ":pattern_matcher_gmock",
2846        "//tensorflow/compiler/xla:literal",
2847        "//tensorflow/compiler/xla:shape_layout",
2848        "//tensorflow/compiler/xla:shape_util",
2849        "//tensorflow/compiler/xla:test",
2850        "//tensorflow/compiler/xla:test_helpers",
2851        "//tensorflow/compiler/xla:util",
2852        "//tensorflow/compiler/xla:xla_data_proto",
2853        "//tensorflow/compiler/xla/service:hlo_parser",
2854        "//tensorflow/compiler/xla/tests:hlo_test_base",
2855        "//tensorflow/compiler/xla/tests:test_utils",
2856        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2857        "//tensorflow/core:lib",
2858        "//tensorflow/core:test",
2859        "@com_google_absl//absl/types:span",
2860    ],
2861)
2862
2863cc_library(
2864    name = "hlo_pass",
2865    hdrs = [
2866        "hlo_pass_fix.h",
2867        "hlo_pass_interface.h",
2868    ],
2869    deps = [
2870        ":hlo",
2871        ":hlo_module_group",
2872        "//tensorflow/compiler/xla:status_macros",
2873        "//tensorflow/compiler/xla:statusor",
2874        "//tensorflow/compiler/xla:types",
2875        "//tensorflow/core:lib",
2876    ],
2877)
2878
2879cc_library(
2880    name = "hlo_pass_pipeline",
2881    srcs = [
2882        "hlo_pass_pipeline.cc",
2883    ],
2884    hdrs = [
2885        "hlo_pass_pipeline.h",
2886    ],
2887    deps = [
2888        ":dump",
2889        ":hlo",
2890        ":hlo_graph_dumper",
2891        ":hlo_pass",
2892        ":hlo_proto_util",
2893        "//tensorflow/compiler/xla:status_macros",
2894        "//tensorflow/compiler/xla:statusor",
2895        "//tensorflow/compiler/xla:types",
2896        "//tensorflow/compiler/xla:util",
2897        "//tensorflow/core:lib",
2898        "//tensorflow/core:regexp_internal",
2899        "@com_google_absl//absl/container:flat_hash_map",
2900        "@com_google_absl//absl/container:flat_hash_set",
2901        "@com_google_absl//absl/memory",
2902        "@com_google_absl//absl/strings",
2903        "@com_google_absl//absl/strings:str_format",
2904    ],
2905)
2906
2907tf_cc_test(
2908    name = "hlo_pass_pipeline_test",
2909    srcs = ["hlo_pass_pipeline_test.cc"],
2910    deps = [
2911        ":hlo",
2912        ":hlo_parser",
2913        ":hlo_pass_pipeline",
2914        "//tensorflow/compiler/xla:test",
2915        "//tensorflow/compiler/xla:test_helpers",
2916        "//tensorflow/compiler/xla:types",
2917        "//tensorflow/compiler/xla:util",
2918        "//tensorflow/compiler/xla:xla_data_proto",
2919        "//tensorflow/compiler/xla/tests:hlo_test_base",
2920        "//tensorflow/compiler/xla/tests:test_utils",
2921        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
2922        "//tensorflow/core:lib",
2923        "//tensorflow/core:test",
2924    ],
2925)
2926
2927cc_library(
2928    name = "hlo_cse",
2929    srcs = ["hlo_cse.cc"],
2930    hdrs = ["hlo_cse.h"],
2931    deps = [
2932        ":hlo",
2933        ":hlo_domain_map",
2934        ":hlo_pass",
2935        "//tensorflow/compiler/xla:literal",
2936        "//tensorflow/compiler/xla:shape_util",
2937        "//tensorflow/compiler/xla:types",
2938        "//tensorflow/core:lib",
2939        "@com_google_absl//absl/container:flat_hash_set",
2940        "@com_google_absl//absl/container:inlined_vector",
2941    ],
2942)
2943
2944tf_cc_test(
2945    name = "hlo_cse_test",
2946    srcs = ["hlo_cse_test.cc"],
2947    deps = [
2948        ":cpu_plugin",
2949        ":hlo",
2950        ":hlo_cse",
2951        ":hlo_matchers",
2952        "//tensorflow/compiler/xla:literal",
2953        "//tensorflow/compiler/xla:shape_util",
2954        "//tensorflow/compiler/xla:types",
2955        "//tensorflow/compiler/xla:util",
2956        "//tensorflow/compiler/xla:xla_data_proto",
2957        "//tensorflow/compiler/xla/service:hlo_parser",
2958        "//tensorflow/compiler/xla/tests:hlo_test_base",
2959        "//tensorflow/compiler/xla/tests:literal_test_util",
2960        "//tensorflow/compiler/xla/tests:test_utils",
2961        "//tensorflow/core:lib",
2962        "@com_google_absl//absl/memory",
2963    ],
2964)
2965
2966cc_library(
2967    name = "hlo_constant_folding",
2968    srcs = ["hlo_constant_folding.cc"],
2969    hdrs = ["hlo_constant_folding.h"],
2970    deps = [
2971        ":hlo",
2972        ":hlo_evaluator",
2973        ":hlo_pass",
2974        ":hlo_query",
2975        "//tensorflow/compiler/xla:literal",
2976        "//tensorflow/compiler/xla:shape_util",
2977        "//tensorflow/compiler/xla:types",
2978        "//tensorflow/core:lib",
2979        "@com_google_absl//absl/memory",
2980    ],
2981)
2982
2983tf_cc_test(
2984    name = "hlo_constant_folding_test",
2985    srcs = ["hlo_constant_folding_test.cc"],
2986    deps = [
2987        ":hlo",
2988        ":hlo_constant_folding",
2989        ":hlo_matchers",
2990        ":hlo_parser",
2991        ":hlo_pass",
2992        ":pattern_matcher",
2993        ":pattern_matcher_gmock",
2994        "//tensorflow/compiler/xla:literal",
2995        "//tensorflow/compiler/xla:shape_util",
2996        "//tensorflow/compiler/xla:test",
2997        "//tensorflow/compiler/xla:types",
2998        "//tensorflow/compiler/xla/tests:hlo_test_base",
2999        "//tensorflow/compiler/xla/tests:literal_test_util",
3000        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3001    ],
3002)
3003
3004cc_library(
3005    name = "hlo_domain_map",
3006    srcs = ["hlo_domain_map.cc"],
3007    hdrs = ["hlo_domain_map.h"],
3008    deps = [
3009        ":hlo",
3010        "//tensorflow/compiler/xla:statusor",
3011        "//tensorflow/compiler/xla:types",
3012        "//tensorflow/compiler/xla:util",
3013        "//tensorflow/core:lib",
3014        "@com_google_absl//absl/container:flat_hash_map",
3015        "@com_google_absl//absl/container:flat_hash_set",
3016        "@com_google_absl//absl/memory",
3017    ],
3018)
3019
3020cc_library(
3021    name = "hlo_domain_verifier",
3022    srcs = ["hlo_domain_verifier.cc"],
3023    hdrs = ["hlo_domain_verifier.h"],
3024    deps = [
3025        ":hlo",
3026        ":hlo_domain_map",
3027        ":hlo_graph_dumper",
3028        ":hlo_pass",
3029        "//tensorflow/compiler/xla:types",
3030        "//tensorflow/core:lib",
3031    ],
3032)
3033
3034cc_library(
3035    name = "hlo_domain_isolator",
3036    srcs = ["hlo_domain_isolator.cc"],
3037    hdrs = ["hlo_domain_isolator.h"],
3038    deps = [
3039        ":hlo",
3040        ":hlo_graph_dumper",
3041        ":hlo_pass",
3042        "//tensorflow/compiler/xla:types",
3043        "//tensorflow/compiler/xla:util",
3044    ],
3045)
3046
3047cc_library(
3048    name = "hlo_domain_remover",
3049    srcs = ["hlo_domain_remover.cc"],
3050    hdrs = ["hlo_domain_remover.h"],
3051    deps = [
3052        ":hlo",
3053        ":hlo_domain_map",
3054        ":hlo_domain_verifier",
3055        ":hlo_graph_dumper",
3056        ":hlo_pass",
3057        "//tensorflow/compiler/xla:types",
3058        "//tensorflow/core:lib",
3059    ],
3060)
3061
3062tf_cc_test(
3063    name = "hlo_domain_test",
3064    srcs = ["hlo_domain_test.cc"],
3065    deps = [
3066        ":hlo",
3067        ":hlo_domain_isolator",
3068        ":hlo_domain_remover",
3069        ":hlo_parser",
3070        "//tensorflow/compiler/xla:debug_options_flags",
3071        "//tensorflow/compiler/xla:test",
3072        "//tensorflow/compiler/xla/tests:hlo_test_base",
3073        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3074        "//tensorflow/core:test",
3075        "@com_google_absl//absl/memory",
3076    ],
3077)
3078
3079cc_library(
3080    name = "hlo_element_type_converter",
3081    srcs = ["hlo_element_type_converter.cc"],
3082    hdrs = ["hlo_element_type_converter.h"],
3083    deps = [
3084        ":hlo",
3085        ":hlo_evaluator",
3086        ":hlo_pass",
3087        ":hlo_query",
3088        "//tensorflow/compiler/xla:literal",
3089        "//tensorflow/compiler/xla:shape_util",
3090        "//tensorflow/compiler/xla:types",
3091        "//tensorflow/core:lib",
3092    ],
3093)
3094
3095tf_cc_test(
3096    name = "hlo_element_type_converter_test",
3097    srcs = ["hlo_element_type_converter_test.cc"],
3098    deps = [
3099        ":hlo_element_type_converter",
3100        ":hlo_matchers",
3101        "//tensorflow/compiler/xla/tests:hlo_test_base",
3102    ],
3103)
3104
3105cc_library(
3106    name = "hlo_get_dimension_size_rewriter",
3107    srcs = ["hlo_get_dimension_size_rewriter.cc"],
3108    hdrs = ["hlo_get_dimension_size_rewriter.h"],
3109    deps = [
3110        ":dynamic_dimension_inference",
3111        ":hlo",
3112        ":hlo_pass",
3113        ":shape_inference",
3114        "//tensorflow/compiler/xla:literal_util",
3115        "@com_google_absl//absl/algorithm:container",
3116    ],
3117)
3118
3119tf_cc_test(
3120    name = "hlo_get_dimension_size_rewriter_test",
3121    srcs = ["hlo_get_dimension_size_rewriter_test.cc"],
3122    deps = [
3123        ":hlo",
3124        ":hlo_get_dimension_size_rewriter",
3125        ":hlo_matchers",
3126        ":hlo_parser",
3127        "//tensorflow/compiler/xla:literal",
3128        "//tensorflow/compiler/xla:shape_util",
3129        "//tensorflow/compiler/xla:types",
3130        "//tensorflow/compiler/xla:util",
3131        "//tensorflow/compiler/xla:xla_data_proto",
3132        "//tensorflow/compiler/xla/tests:hlo_test_base",
3133        "//tensorflow/compiler/xla/tests:literal_test_util",
3134        "//tensorflow/compiler/xla/tests:test_utils",
3135        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3136        "//tensorflow/core:lib",
3137        "//tensorflow/core:test",
3138    ],
3139)
3140
3141cc_library(
3142    name = "device_memory_allocator",
3143    srcs = [
3144        "device_memory_allocator.cc",
3145        "owning_device_memory.cc",
3146    ],
3147    hdrs = [
3148        "device_memory_allocator.h",
3149        "owning_device_memory.h",
3150    ],
3151    deps = [
3152        "//tensorflow/compiler/xla:status_macros",
3153        "//tensorflow/compiler/xla:statusor",
3154        "//tensorflow/compiler/xla:types",
3155        "//tensorflow/compiler/xla:util",
3156        "//tensorflow/core:lib",
3157        "//tensorflow/core:stream_executor_no_cuda",
3158        "@com_google_absl//absl/types:span",
3159    ],
3160)
3161
3162cc_library(
3163    name = "maybe_owning_device_memory",
3164    srcs = [
3165        "maybe_owning_device_memory.cc",
3166    ],
3167    hdrs = [
3168        "maybe_owning_device_memory.h",
3169    ],
3170    deps = [
3171        ":device_memory_allocator",
3172        "@com_google_absl//absl/types:optional",
3173        "@com_google_absl//absl/types:variant",
3174    ],
3175)
3176
3177cc_library(
3178    name = "elemental_ir_emitter",
3179    srcs = ["elemental_ir_emitter.cc"],
3180    hdrs = ["elemental_ir_emitter.h"],
3181    deps = [
3182        ":hlo",
3183        ":hlo_casting_utils",
3184        ":hlo_module_config",
3185        "//tensorflow/compiler/xla:shape_util",
3186        "//tensorflow/compiler/xla:status_macros",
3187        "//tensorflow/compiler/xla:statusor",
3188        "//tensorflow/compiler/xla:types",
3189        "//tensorflow/compiler/xla:util",
3190        "//tensorflow/compiler/xla:xla_data_proto",
3191        "//tensorflow/compiler/xla/service/llvm_ir:ir_array",
3192        "//tensorflow/compiler/xla/service/llvm_ir:ir_builder_mixin",
3193        "//tensorflow/compiler/xla/service/llvm_ir:llvm_loop",
3194        "//tensorflow/compiler/xla/service/llvm_ir:llvm_util",
3195        "//tensorflow/compiler/xla/service/llvm_ir:loop_emitter",
3196        "//tensorflow/core:lib",
3197        "//tensorflow/core:lib_internal",
3198        "@com_google_absl//absl/algorithm:container",
3199        "@com_google_absl//absl/container:flat_hash_map",
3200        "@com_google_absl//absl/strings",
3201        "@llvm//:core",
3202        "@llvm//:transform_utils",
3203    ],
3204)
3205
3206xla_test(
3207    name = "elemental_ir_emitter_test",
3208    srcs = ["elemental_ir_emitter_test.cc"],
3209    backends = [
3210        "cpu",
3211        "gpu",
3212    ],
3213    deps = [
3214        "//tensorflow/compiler/xla:execution_options_util",
3215        "//tensorflow/compiler/xla:status_macros",
3216        "//tensorflow/compiler/xla:test",
3217        "//tensorflow/compiler/xla/service:hlo_parser",
3218        "//tensorflow/compiler/xla/tests:client_library_test_base",
3219        "//tensorflow/compiler/xla/tests:hlo_test_base",
3220        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3221    ],
3222)
3223
3224cc_library(
3225    name = "hlo_module_config",
3226    srcs = ["hlo_module_config.cc"],
3227    hdrs = ["hlo_module_config.h"],
3228    deps = [
3229        ":computation_layout",
3230        ":computation_placer",
3231        "//tensorflow/compiler/xla:shape_layout",
3232        "//tensorflow/compiler/xla:types",
3233        "//tensorflow/compiler/xla:xla_data_proto",
3234        "//tensorflow/compiler/xla:xla_proto",
3235        "@com_google_absl//absl/memory",
3236        "@com_google_absl//absl/strings",
3237        "@com_google_absl//absl/types:optional",
3238    ],
3239)
3240
3241cc_library(
3242    name = "computation_layout",
3243    srcs = ["computation_layout.cc"],
3244    hdrs = ["computation_layout.h"],
3245    deps = [
3246        "//tensorflow/compiler/xla:shape_layout",
3247        "//tensorflow/compiler/xla:types",
3248        "//tensorflow/compiler/xla:xla_data_proto",
3249        "//tensorflow/core:lib",
3250        "@com_google_absl//absl/strings",
3251    ],
3252)
3253
3254cc_library(
3255    name = "hlo_subcomputation_unification",
3256    srcs = ["hlo_subcomputation_unification.cc"],
3257    hdrs = ["hlo_subcomputation_unification.h"],
3258    deps = [
3259        ":hlo_pass",
3260    ],
3261)
3262
3263tf_cc_test(
3264    name = "hlo_subcomputation_unification_test",
3265    srcs = ["hlo_subcomputation_unification_test.cc"],
3266    deps = [
3267        ":hlo",
3268        ":hlo_graph_dumper",
3269        ":hlo_subcomputation_unification",
3270        "//tensorflow/compiler/xla:shape_util",
3271        "//tensorflow/compiler/xla/tests:hlo_test_base",
3272        "//tensorflow/compiler/xla/tests:test_utils",
3273        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3274    ],
3275)
3276
3277cc_library(
3278    name = "hlo_graph_dumper",
3279    srcs = ["hlo_graph_dumper.cc"],
3280    hdrs = ["hlo_graph_dumper.h"],
3281    deps = [
3282        ":hlo",
3283        ":hlo_casting_utils",
3284        ":hlo_execution_profile",
3285        ":pattern_matcher",
3286        "//tensorflow/compiler/xla:literal",
3287        "//tensorflow/compiler/xla:shape_util",
3288        "//tensorflow/compiler/xla:types",
3289        "//tensorflow/compiler/xla:util",
3290        "//tensorflow/compiler/xla:window_util",
3291        "//tensorflow/compiler/xla:xla_proto",
3292        "//tensorflow/core:lib",
3293        "//tensorflow/core:lib_internal",
3294        "//tensorflow/core:regexp_internal",
3295        "@com_google_absl//absl/container:flat_hash_map",
3296        "@com_google_absl//absl/strings",
3297        "@com_google_absl//absl/strings:str_format",
3298        "@com_google_absl//absl/types:optional",
3299    ],
3300    alwayslink = 1,
3301)
3302
3303tf_cc_test(
3304    name = "hlo_graph_dumper_test",
3305    srcs = ["hlo_graph_dumper_test.cc"],
3306    deps = [
3307        ":hlo",
3308        ":hlo_graph_dumper",
3309        "//tensorflow/compiler/xla:literal_util",
3310        "//tensorflow/compiler/xla:test",
3311        "//tensorflow/compiler/xla:xla_proto",
3312        "//tensorflow/compiler/xla/tests:hlo_test_base",
3313        "//tensorflow/compiler/xla/tests:test_utils",
3314        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
3315        "//tensorflow/core:lib",
3316        "@com_google_absl//absl/strings",
3317    ],
3318)
3319
3320cc_library(
3321    name = "transpose_folding",
3322    srcs = ["transpose_folding.cc"],
3323    hdrs = ["transpose_folding.h"],
3324    deps = [
3325        ":hlo",
3326        ":hlo_pass",
3327        "//tensorflow/compiler/xla:shape_util",
3328        "//tensorflow/compiler/xla:status_macros",
3329        "//tensorflow/compiler/xla:util",
3330        "//tensorflow/core:lib",
3331    ],
3332)
3333
3334tf_cc_test(
3335    name = "transpose_folding_test",
3336    srcs = ["transpose_folding_test.cc"],
3337    deps = [
3338        ":hlo",
3339        ":hlo_matchers",
3340        ":shape_inference",
3341        ":transpose_folding",
3342        "//tensorflow/compiler/xla:literal",
3343        "//tensorflow/compiler/xla:shape_util",
3344        "//tensorflow/compiler/xla:test",
3345        "//tensorflow/compiler/xla:test_helpers",
3346        "//tensorflow/compiler/xla:xla_data_proto",
3347        "//tensorflow/compiler/xla/client:xla_builder",
3348        "//tensorflow/compiler/xla/service:hlo_parser",
3349        "//tensorflow/compiler/xla/service/gpu:ir_emission_utils",
3350        "//tensorflow/compiler/xla/tests:hlo_test_base",
3351        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3352        "//tensorflow/core:lib",
3353    ],
3354)
3355
3356cc_library(
3357    name = "zero_sized_hlo_elimination",
3358    srcs = ["zero_sized_hlo_elimination.cc"],
3359    hdrs = ["zero_sized_hlo_elimination.h"],
3360    deps = [
3361        ":hlo",
3362        ":hlo_pass",
3363        "//tensorflow/compiler/xla:literal",
3364        "//tensorflow/compiler/xla:shape_util",
3365        "//tensorflow/compiler/xla:status_macros",
3366        "//tensorflow/compiler/xla:util",
3367        "//tensorflow/core:lib",
3368    ],
3369)
3370
3371tf_cc_test(
3372    name = "zero_sized_hlo_elimination_test",
3373    srcs = ["zero_sized_hlo_elimination_test.cc"],
3374    deps = [
3375        ":hlo",
3376        ":shape_inference",
3377        ":zero_sized_hlo_elimination",
3378        "//tensorflow/compiler/xla:literal",
3379        "//tensorflow/compiler/xla:shape_util",
3380        "//tensorflow/compiler/xla:status_macros",
3381        "//tensorflow/compiler/xla:test",
3382        "//tensorflow/compiler/xla:test_helpers",
3383        "//tensorflow/compiler/xla:xla_data_proto",
3384        "//tensorflow/compiler/xla/client:xla_builder",
3385        "//tensorflow/compiler/xla/tests:hlo_test_base",
3386        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3387        "//tensorflow/core:lib",
3388    ],
3389)
3390
3391cc_library(
3392    name = "stream_pool",
3393    srcs = ["stream_pool.cc"],
3394    hdrs = ["stream_pool.h"],
3395    deps = [
3396        "//tensorflow/compiler/xla:types",
3397        "//tensorflow/core:lib",
3398        "//tensorflow/core:stream_executor_no_cuda",
3399        "@com_google_absl//absl/memory",
3400    ],
3401)
3402
3403tf_cc_test(
3404    name = "stream_pool_test",
3405    srcs = ["stream_pool_test.cc"],
3406    deps = [
3407        ":stream_pool",
3408        "//tensorflow/compiler/xla:test_helpers",
3409        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3410        "//tensorflow/core:stream_executor_no_cuda",
3411    ],
3412)
3413
3414cc_library(
3415    name = "hlo_proto_util",
3416    srcs = ["hlo_proto_util.cc"],
3417    hdrs = ["hlo_proto_util.h"],
3418    deps = [
3419        ":buffer_assignment",
3420        ":hlo",
3421        ":hlo_proto",
3422        ":hlo_verifier",
3423        "//tensorflow/compiler/xla:status",
3424        "//tensorflow/compiler/xla:util",
3425    ],
3426)
3427
3428tf_cc_test(
3429    name = "hlo_proto_util_test",
3430    srcs = ["hlo_proto_util_test.cc"],
3431    deps = [
3432        ":hlo",
3433        ":hlo_proto",
3434        ":hlo_proto_util",
3435        "//tensorflow/compiler/xla:shape_util",
3436        "//tensorflow/compiler/xla:status_macros",
3437        "//tensorflow/compiler/xla:test",
3438        "//tensorflow/compiler/xla:types",
3439        "//tensorflow/compiler/xla/tests:hlo_test_base",
3440        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3441        "//tensorflow/core:lib",
3442    ],
3443)
3444
3445cc_library(
3446    name = "reduce_precision_insertion",
3447    srcs = ["reduce_precision_insertion.cc"],
3448    hdrs = ["reduce_precision_insertion.h"],
3449    deps = [
3450        ":buffer_liveness",
3451        ":hlo",
3452        ":hlo_pass",
3453        ":hlo_pass_pipeline",
3454        "//tensorflow/compiler/xla:shape_util",
3455        "//tensorflow/core:lib",
3456    ],
3457)
3458
3459tf_cc_test(
3460    name = "reduce_precision_insertion_test",
3461    size = "small",
3462    srcs = ["reduce_precision_insertion_test.cc"],
3463    deps = [
3464        ":hlo",
3465        ":hlo_matchers",
3466        ":reduce_precision_insertion",
3467        "//tensorflow/compiler/xla:shape_util",
3468        "//tensorflow/compiler/xla:test",
3469        "//tensorflow/compiler/xla:test_helpers",
3470        "//tensorflow/compiler/xla:xla_data_proto",
3471        "//tensorflow/compiler/xla/tests:hlo_test_base",
3472        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3473    ],
3474)
3475
3476cc_library(
3477    name = "hlo_runner",
3478    srcs = ["hlo_runner.cc"],
3479    hdrs = ["hlo_runner.h"],
3480    deps = [
3481        ":backend",
3482        ":compiler",
3483        ":computation_placer",
3484        ":executable",
3485        ":hlo",
3486        ":hlo_module_group",
3487        ":hlo_parser",
3488        ":transfer_manager",
3489        "//tensorflow/compiler/xla:shape_util",
3490        "//tensorflow/compiler/xla:status_macros",
3491        "//tensorflow/compiler/xla:statusor",
3492        "//tensorflow/compiler/xla:types",
3493        "//tensorflow/compiler/xla:util",
3494        "//tensorflow/compiler/xla:xla_data_proto",
3495        "//tensorflow/core:core_cpu_internal",
3496        "//tensorflow/core:lib",
3497        "//tensorflow/core:lib_internal",
3498        "//tensorflow/core:stream_executor_no_cuda",
3499        "//third_party/eigen3",
3500        "@com_google_absl//absl/memory",
3501        "@com_google_absl//absl/types:span",
3502    ],
3503)
3504
3505cc_library(
3506    name = "hlo_profile_printer",
3507    srcs = ["hlo_profile_printer.cc"],
3508    hdrs = ["hlo_profile_printer.h"],
3509    deps = [
3510        ":hlo_profile_printer_data",
3511        ":human_readable_profile_builder",
3512        "//tensorflow/compiler/xla:types",
3513        "@com_google_absl//absl/algorithm:container",
3514        "@com_google_absl//absl/strings",
3515    ],
3516)
3517
3518cc_library(
3519    name = "sort_simplifier",
3520    srcs = ["sort_simplifier.cc"],
3521    hdrs = ["sort_simplifier.h"],
3522    deps = [
3523        ":hlo",
3524        ":hlo_pass",
3525        "//tensorflow/compiler/xla:statusor",
3526        "@com_google_absl//absl/container:flat_hash_map",
3527        "@com_google_absl//absl/container:flat_hash_set",
3528    ],
3529)
3530
3531tf_cc_test(
3532    name = "sort_simplifier_test",
3533    srcs = ["sort_simplifier_test.cc"],
3534    deps = [
3535        ":hlo_matchers",
3536        ":hlo_parser",
3537        ":pattern_matcher",
3538        ":pattern_matcher_gmock",
3539        ":sort_simplifier",
3540        "//tensorflow/compiler/xla:test",
3541        "//tensorflow/compiler/xla/tests:hlo_test_base",
3542        "//tensorflow/core:test",
3543    ],
3544)
3545
3546cc_library(
3547    name = "stable_sort_expander",
3548    srcs = ["stable_sort_expander.cc"],
3549    hdrs = ["stable_sort_expander.h"],
3550    deps = [
3551        ":hlo",
3552        ":hlo_casting_utils",
3553        ":hlo_pass",
3554        ":op_expander_pass",
3555        "//tensorflow/compiler/xla:statusor",
3556        "@com_google_absl//absl/container:flat_hash_map",
3557        "@com_google_absl//absl/container:flat_hash_set",
3558    ],
3559)
3560
3561tf_cc_test(
3562    name = "stable_sort_expander_test",
3563    srcs = ["stable_sort_expander_test.cc"],
3564    deps = [
3565        ":algebraic_simplifier",
3566        ":hlo_matchers",
3567        ":hlo_parser",
3568        ":pattern_matcher",
3569        ":pattern_matcher_gmock",
3570        ":stable_sort_expander",
3571        "//tensorflow/compiler/xla:test",
3572        "//tensorflow/compiler/xla/tests:hlo_test_base",
3573        "//tensorflow/core:test",
3574    ],
3575)
3576
3577cc_library(
3578    name = "tuple_util",
3579    srcs = ["tuple_util.cc"],
3580    hdrs = ["tuple_util.h"],
3581    deps = [
3582        ":hlo",
3583        "@com_google_absl//absl/types:span",
3584    ],
3585)
3586
3587tf_cc_test(
3588    name = "tuple_util_test",
3589    srcs = ["tuple_util_test.cc"],
3590    deps = [
3591        ":tuple_util",
3592        "//tensorflow/compiler/xla:test",
3593        "//tensorflow/compiler/xla/service:hlo_matchers",
3594        "//tensorflow/compiler/xla/service:hlo_parser",
3595        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3596    ],
3597)
3598
3599cc_library(
3600    name = "while_util",
3601    srcs = ["while_util.cc"],
3602    hdrs = ["while_util.h"],
3603    deps = [
3604        ":call_inliner",
3605        ":hlo",
3606        ":hlo_creation_utils",
3607        ":tuple_util",
3608        "//tensorflow/compiler/xla:literal_util",
3609        "@com_google_absl//absl/algorithm:container",
3610        "@com_google_absl//absl/container:flat_hash_map",
3611        "@com_google_absl//absl/container:inlined_vector",
3612        "@com_google_absl//absl/strings",
3613    ],
3614)
3615
3616tf_cc_test(
3617    name = "while_util_test",
3618    srcs = ["while_util_test.cc"],
3619    deps = [
3620        ":while_util",
3621        "//tensorflow/compiler/xla:test",
3622        "//tensorflow/compiler/xla:util",
3623        "//tensorflow/compiler/xla/service:hlo_matchers",
3624        "//tensorflow/compiler/xla/service:hlo_parser",
3625        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3626        "@com_google_absl//absl/algorithm:container",
3627    ],
3628)
3629
3630cc_library(
3631    name = "while_loop_invariant_code_motion",
3632    srcs = ["while_loop_invariant_code_motion.cc"],
3633    hdrs = ["while_loop_invariant_code_motion.h"],
3634    deps = [
3635        ":hlo",
3636        ":hlo_pass",
3637        ":tuple_util",
3638        ":while_loop_analysis",
3639        ":while_util",
3640        "//tensorflow/compiler/xla:shape_util",
3641        "//tensorflow/compiler/xla:statusor",
3642        "//tensorflow/compiler/xla:util",
3643        "@com_google_absl//absl/algorithm:container",
3644        "@com_google_absl//absl/container:flat_hash_map",
3645        "@com_google_absl//absl/container:flat_hash_set",
3646        "@com_google_absl//absl/container:inlined_vector",
3647    ],
3648)
3649
3650tf_cc_test(
3651    name = "while_loop_invariant_code_motion_test",
3652    srcs = ["while_loop_invariant_code_motion_test.cc"],
3653    deps = [
3654        ":hlo_matchers",
3655        ":while_loop_invariant_code_motion",
3656        "//tensorflow/compiler/xla:test",
3657        "//tensorflow/compiler/xla/service:hlo_parser",
3658        "//tensorflow/compiler/xla/tests:hlo_test_base",
3659        "//tensorflow/core:test",
3660    ],
3661)
3662
3663cc_library(
3664    name = "while_loop_constant_sinking",
3665    srcs = ["while_loop_constant_sinking.cc"],
3666    hdrs = ["while_loop_constant_sinking.h"],
3667    deps = [
3668        ":hlo",
3669        ":hlo_pass",
3670        ":while_util",
3671        "//tensorflow/compiler/xla:statusor",
3672        "//tensorflow/compiler/xla:util",
3673        "@com_google_absl//absl/algorithm:container",
3674        "@com_google_absl//absl/container:inlined_vector",
3675    ],
3676)
3677
3678tf_cc_test(
3679    name = "while_loop_constant_sinking_test",
3680    srcs = ["while_loop_constant_sinking_test.cc"],
3681    deps = [
3682        ":hlo_matchers",
3683        ":while_loop_constant_sinking",
3684        "//tensorflow/compiler/xla:test",
3685        "//tensorflow/compiler/xla/service:hlo_parser",
3686        "//tensorflow/compiler/xla/tests:hlo_test_base",
3687        "//tensorflow/core:test",
3688    ],
3689)
3690
3691cc_library(
3692    name = "despecializer",
3693    srcs = ["despecializer.cc"],
3694    hdrs = ["despecializer.h"],
3695    deps = [
3696        ":bfloat16_normalization",
3697        ":defuser",
3698        ":hlo",
3699        ":hlo_memory_scheduler",
3700        ":hlo_pass",
3701        ":hlo_pass_pipeline",
3702        "//tensorflow/compiler/xla:statusor",
3703    ],
3704)
3705
3706cc_library(
3707    name = "source_map_util",
3708    srcs = [],
3709    hdrs = ["source_map_util.h"],
3710    deps = [
3711        ":executable",
3712        "//tensorflow/compiler/xla:status",
3713        "//tensorflow/core:lib",
3714        "@com_google_absl//absl/strings:str_format",
3715    ],
3716)
3717
3718cc_library(
3719    name = "indexed_array_analysis",
3720    srcs = ["indexed_array_analysis.cc"],
3721    hdrs = ["indexed_array_analysis.h"],
3722    deps = [
3723        ":hlo",
3724        ":hlo_evaluator",
3725        ":hlo_pass",
3726        "//tensorflow/compiler/xla:util",
3727        "//tensorflow/core:ptr_util",
3728        "@com_google_absl//absl/algorithm:container",
3729        "@com_google_absl//absl/container:flat_hash_map",
3730        "@com_google_absl//absl/container:flat_hash_set",
3731        "@com_google_absl//absl/container:inlined_vector",
3732        "@com_google_absl//absl/strings",
3733        "@com_google_absl//absl/types:optional",
3734    ],
3735)
3736
3737tf_cc_test(
3738    name = "indexed_array_analysis_test",
3739    srcs = ["indexed_array_analysis_test.cc"],
3740    extra_copts = ["-Wno-string-plus-int"],
3741    deps = [
3742        ":hlo_matchers",
3743        ":hlo_parser",
3744        ":indexed_array_analysis",
3745        "//tensorflow/compiler/xla:test",
3746        "//tensorflow/compiler/xla/tests:hlo_test_base",
3747        "//tensorflow/compiler/xla/tests:test_utils",
3748        "//tensorflow/core:test",
3749        "@com_google_absl//absl/strings",
3750    ],
3751)
3752
3753cc_library(
3754    name = "hlo_parser",
3755    srcs = ["hlo_parser.cc"],
3756    hdrs = ["hlo_parser.h"],
3757    deps = [
3758        ":hlo",
3759        ":hlo_lexer",
3760        "//tensorflow/compiler/xla:literal",
3761        "//tensorflow/compiler/xla:literal_util",
3762        "//tensorflow/compiler/xla:shape_util",
3763        "//tensorflow/compiler/xla:statusor",
3764        "//tensorflow/compiler/xla:util",
3765        "//tensorflow/compiler/xla:xla_data_proto",
3766        "//tensorflow/core:lib",
3767        "//tensorflow/core:lib_internal",
3768        "@com_google_absl//absl/algorithm:container",
3769        "@com_google_absl//absl/memory",
3770        "@com_google_absl//absl/strings",
3771        "@com_google_absl//absl/strings:str_format",
3772        "@com_google_absl//absl/types:span",
3773        "@com_google_absl//absl/types:variant",
3774    ],
3775)
3776
3777tf_cc_test(
3778    name = "hlo_parser_test",
3779    size = "small",
3780    srcs = ["hlo_parser_test.cc"],
3781    deps = [
3782        ":hlo",
3783        ":hlo_casting_utils",
3784        ":hlo_matchers",
3785        ":hlo_parser",
3786        ":pattern_matcher",
3787        ":pattern_matcher_gmock",
3788        "//tensorflow/compiler/xla:test_helpers",
3789        "//tensorflow/compiler/xla:window_util",
3790        "//tensorflow/core:lib",
3791        "//tensorflow/core:test",
3792        "//tensorflow/core:test_main",  # fixdeps: keep
3793        "@com_google_absl//absl/strings",
3794    ],
3795)
3796
3797cc_library(
3798    name = "hlo_lexer",
3799    srcs = ["hlo_lexer.cc"],
3800    hdrs = [
3801        "hlo_lexer.h",
3802    ],
3803    deps = [
3804        "//tensorflow/compiler/xla:shape_util",
3805        "//tensorflow/compiler/xla:statusor",
3806        "//tensorflow/compiler/xla:types",
3807        "//tensorflow/compiler/xla:util",
3808        "//tensorflow/compiler/xla:xla_data_proto",
3809        "//tensorflow/core:lib",
3810        "//tensorflow/core:regexp_internal",
3811        "@com_google_absl//absl/strings",
3812        "@com_google_absl//absl/types:optional",
3813    ],
3814)
3815
3816cc_library(
3817    name = "hlo_casting_utils",
3818    hdrs = ["hlo_casting_utils.h"],
3819    deps = ["//tensorflow/core:lib"],
3820)
3821
3822cc_library(
3823    name = "map_inliner",
3824    srcs = ["map_inliner.cc"],
3825    hdrs = ["map_inliner.h"],
3826    deps = [
3827        ":hlo",
3828        ":hlo_pass",
3829        ":hlo_query",
3830        "//tensorflow/compiler/xla:status_macros",
3831        "//tensorflow/compiler/xla:types",
3832        "//tensorflow/core:lib",
3833        "@com_google_absl//absl/types:span",
3834    ],
3835)
3836
3837cc_library(
3838    name = "optimize_input_output_buffer_alias",
3839    srcs = ["optimize_input_output_buffer_alias.cc"],
3840    hdrs = ["optimize_input_output_buffer_alias.h"],
3841    deps = [
3842        ":hlo",
3843        ":hlo_pass",
3844        "//tensorflow/compiler/xla:shape_tree",
3845        "//tensorflow/compiler/xla:shape_util",
3846        "//tensorflow/compiler/xla:status",
3847        "//tensorflow/compiler/xla:status_macros",
3848        "//tensorflow/compiler/xla:statusor",
3849        "//tensorflow/compiler/xla:util",
3850        "//tensorflow/core:lib",
3851        "@com_google_absl//absl/container:flat_hash_map",
3852        "@com_google_absl//absl/memory",
3853        "@com_google_absl//absl/strings:str_format",
3854    ],
3855)
3856
3857tf_cc_test(
3858    name = "optimize_input_output_buffer_alias_test",
3859    srcs = ["optimize_input_output_buffer_alias_test.cc"],
3860    deps = [
3861        ":optimize_input_output_buffer_alias",
3862        "//tensorflow/compiler/xla:shape_util",
3863        "//tensorflow/compiler/xla:status_macros",
3864        "//tensorflow/compiler/xla:test",
3865        "//tensorflow/compiler/xla:test_helpers",
3866        "//tensorflow/compiler/xla:util",
3867        "//tensorflow/compiler/xla/tests:hlo_test_base",
3868        "//tensorflow/compiler/xla/tests:test_utils",
3869        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3870        "//tensorflow/core:lib",
3871        "//tensorflow/core:test",
3872        "@com_google_absl//absl/container:flat_hash_map",
3873        "@com_google_absl//absl/memory",
3874        "@com_google_absl//absl/strings:str_format",
3875    ],
3876)
3877
3878cc_library(
3879    name = "ar_crs_combiner",
3880    srcs = ["ar_crs_combiner.cc"],
3881    hdrs = ["ar_crs_combiner.h"],
3882    deps = [
3883        ":call_graph",
3884        ":pattern_matcher",
3885        "//tensorflow/compiler/xla:literal",
3886        "//tensorflow/compiler/xla:literal_util",
3887        "//tensorflow/compiler/xla:shape_util",
3888        "//tensorflow/compiler/xla:status_macros",
3889        "//tensorflow/compiler/xla:statusor",
3890        "//tensorflow/compiler/xla:types",
3891        "//tensorflow/compiler/xla/service:hlo",
3892        "//tensorflow/compiler/xla/service:hlo_pass",
3893        "@com_google_absl//absl/container:flat_hash_map",
3894        "@com_google_absl//absl/strings",
3895    ],
3896)
3897
3898cc_library(
3899    name = "dynamic_index_splitter",
3900    srcs = ["dynamic_index_splitter.cc"],
3901    hdrs = ["dynamic_index_splitter.h"],
3902    deps = [
3903        ":hlo_casting_utils",
3904        "//tensorflow/compiler/xla:shape_util",
3905        "//tensorflow/compiler/xla:statusor",
3906        "//tensorflow/compiler/xla/service:hlo",
3907        "//tensorflow/compiler/xla/service:hlo_pass",
3908        "@com_google_absl//absl/container:flat_hash_map",
3909        "@com_google_absl//absl/container:flat_hash_set",
3910        "@com_google_absl//absl/container:inlined_vector",
3911        "@com_google_absl//absl/strings",
3912    ],
3913)
3914
3915tf_cc_test(
3916    name = "dynamic_index_splitter_test",
3917    srcs = ["dynamic_index_splitter_test.cc"],
3918    deps = [
3919        ":dynamic_index_splitter",
3920        ":hlo",
3921        ":hlo_matchers",
3922        "//tensorflow/compiler/xla:statusor",
3923        "//tensorflow/compiler/xla:test",
3924        "//tensorflow/compiler/xla:test_helpers",
3925        "//tensorflow/compiler/xla/tests:hlo_test_base",
3926        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3927    ],
3928)
3929
3930tf_cc_test(
3931    name = "ar_crs_combiner_test",
3932    srcs = ["ar_crs_combiner_test.cc"],
3933    deps = [
3934        ":ar_crs_combiner",
3935        ":hlo",
3936        ":hlo_matchers",
3937        "//tensorflow/compiler/xla:statusor",
3938        "//tensorflow/compiler/xla/tests:hlo_test_base",
3939        "//tensorflow/compiler/xla/tests:xla_internal_test_main",
3940        "//tensorflow/core:lib",
3941        "//tensorflow/core:test",
3942    ],
3943)
3944
3945tf_cc_test(
3946    name = "map_inliner_test",
3947    srcs = ["map_inliner_test.cc"],
3948    deps = [
3949        ":hlo",
3950        ":hlo_matchers",
3951        ":map_inliner",
3952        "//tensorflow/compiler/xla:literal",
3953        "//tensorflow/compiler/xla:shape_util",
3954        "//tensorflow/compiler/xla:test",
3955        "//tensorflow/compiler/xla:xla_data_proto",
3956        "//tensorflow/compiler/xla/tests:hlo_test_base",
3957        "//tensorflow/compiler/xla/tests:literal_test_util",
3958        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
3959        "@com_google_absl//absl/memory",
3960    ],
3961)
3962
3963tf_cc_test(
3964    name = "hlo_casting_utils_test",
3965    srcs = ["hlo_casting_utils_test.cc"],
3966    deps = [
3967        ":hlo",
3968        ":hlo_casting_utils",
3969        "//tensorflow/compiler/xla/tests:xla_internal_test_main",  # fixdeps: keep
3970        "//tensorflow/core:test",
3971    ],
3972)
3973