Skip to content

Commit ca76ccc

Browse files
sdasgup3tensorflower-gardener
authored andcommitted
[HLO Componentization] Populate hlo/testlib sub-component (Phase II).
This CL takes care of 1. Migrating external projects dependencies from ``` tensorflow/compiler/xla:test tensorflow/compiler/xla:test_helpers tensorflow/compiler/xla/service:pattern_matcher_gmock ``` to `tensorflow/compiler/xla/hlo/testlib:*` PiperOrigin-RevId: 714495819
1 parent 2022b91 commit ca76ccc

14 files changed

+41
-41
lines changed

third_party/xla/xla/hlo/transforms/BUILD

+21-21
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ xla_cc_test(
5656
"//xla:comparison_util",
5757
"//xla:literal_util",
5858
"//xla:shape_util",
59-
"//xla:test",
60-
"//xla:test_helpers",
6159
"//xla:xla_data_proto_cc",
6260
"//xla/hlo/ir:hlo",
6361
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
62+
"//xla/hlo/testlib:test",
63+
"//xla/hlo/testlib:test_helpers",
6464
"//xla/service:float_support",
6565
"//xla/service:hlo_verifier",
6666
"//xla/tests:literal_test_util",
@@ -202,14 +202,14 @@ xla_cc_test(
202202
":real_imag_expander",
203203
"//xla:literal",
204204
"//xla:shape_util",
205-
"//xla:test",
206205
"//xla:types",
207206
"//xla/hlo/ir:hlo",
208207
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
208+
"//xla/hlo/testlib:pattern_matcher_gmock",
209+
"//xla/hlo/testlib:test",
209210
"//xla/hlo/utils:hlo_matchers",
210211
"//xla/service:hlo_creation_utils",
211212
"//xla/service:pattern_matcher",
212-
"//xla/service:pattern_matcher_gmock",
213213
"//xla/tsl/lib/core:status_test_util",
214214
"@com_google_googletest//:gtest",
215215
"@local_tsl//tsl/platform:test_main",
@@ -268,9 +268,9 @@ xla_cc_test(
268268
srcs = ["expanders/convolution_4d_expander_test.cc"],
269269
deps = [
270270
"convolution_4d_expander",
271-
"//xla:test",
272271
"//xla/hlo/ir:hlo",
273272
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
273+
"//xla/hlo/testlib:test",
274274
"@com_google_googletest//:gtest",
275275
"@local_tsl//tsl/platform:statusor",
276276
"@local_tsl//tsl/platform:test_main",
@@ -304,8 +304,8 @@ xla_cc_test(
304304
"//xla:xla_data_proto_cc",
305305
"//xla/hlo/ir:hlo",
306306
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
307+
"//xla/hlo/testlib:pattern_matcher_gmock",
307308
"//xla/service:pattern_matcher",
308-
"//xla/service:pattern_matcher_gmock",
309309
"@com_google_googletest//:gtest_main",
310310
"@local_tsl//tsl/platform:statusor",
311311
"@local_tsl//tsl/platform:test_main",
@@ -335,14 +335,14 @@ xla_cc_test(
335335
srcs = ["expanders/logistic_expander_test.cc"],
336336
deps = [
337337
":logistic_expander",
338-
"//xla:test",
339338
"//xla:xla_data_proto_cc",
340339
"//xla/hlo/ir:hlo",
341340
"//xla/hlo/parser:hlo_parser",
342341
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
342+
"//xla/hlo/testlib:pattern_matcher_gmock",
343+
"//xla/hlo/testlib:test",
343344
"//xla/service:dynamic_padder",
344345
"//xla/service:pattern_matcher",
345-
"//xla/service:pattern_matcher_gmock",
346346
"@com_google_absl//absl/strings:string_view",
347347
"@com_google_googletest//:gtest",
348348
"@local_tsl//tsl/platform:statusor",
@@ -417,9 +417,9 @@ xla_cc_test(
417417
srcs = ["while_loop_trip_count_annotator_test.cc"],
418418
deps = [
419419
":while_loop_trip_count_annotator",
420-
"//xla:test",
421420
"//xla:xla_data_proto_cc",
422421
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
422+
"//xla/hlo/testlib:test",
423423
"@com_google_googletest//:gtest",
424424
"@local_tsl//tsl/platform:statusor",
425425
"@local_tsl//tsl/platform:test_main", # fixdeps: keep
@@ -512,9 +512,9 @@ xla_cc_test(
512512
":dot_decomposer",
513513
"//xla/hlo/ir:hlo",
514514
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
515+
"//xla/hlo/testlib:pattern_matcher_gmock",
515516
"//xla/hlo/utils:hlo_matchers",
516517
"//xla/service:pattern_matcher",
517-
"//xla/service:pattern_matcher_gmock",
518518
"@com_google_absl//absl/strings:string_view",
519519
"@com_google_googletest//:gtest",
520520
"@local_tsl//tsl/platform:statusor",
@@ -560,10 +560,10 @@ xla_cc_test(
560560
srcs = ["expanders/reduce_decomposer_test.cc"],
561561
deps = [
562562
":reduce_decomposer",
563-
"//xla:test",
564-
"//xla:test_helpers",
565563
"//xla/hlo/parser:hlo_parser",
566564
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
565+
"//xla/hlo/testlib:test",
566+
"//xla/hlo/testlib:test_helpers",
567567
"@com_google_googletest//:gtest",
568568
"@local_tsl//tsl/platform:test_main",
569569
],
@@ -574,10 +574,10 @@ xla_cc_test(
574574
srcs = ["expanders/reshape_decomposer_test.cc"],
575575
deps = [
576576
":reshape_decomposer",
577-
"//xla:test",
578-
"//xla:test_helpers",
579577
"//xla/hlo/parser:hlo_parser",
580578
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
579+
"//xla/hlo/testlib:test",
580+
"//xla/hlo/testlib:test_helpers",
581581
"@com_google_absl//absl/algorithm:container",
582582
"@com_google_absl//absl/strings:string_view",
583583
"@com_google_googletest//:gtest",
@@ -638,13 +638,13 @@ xla_cc_test(
638638
srcs = ["expanders/stable_sort_expander_test.cc"],
639639
deps = [
640640
":stable_sort_expander",
641-
"//xla:test",
642641
"//xla/hlo/parser:hlo_parser",
643642
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
643+
"//xla/hlo/testlib:pattern_matcher_gmock",
644+
"//xla/hlo/testlib:test",
644645
"//xla/hlo/transforms/simplifiers:algebraic_simplifier",
645646
"//xla/hlo/utils:hlo_matchers",
646647
"//xla/service:pattern_matcher",
647-
"//xla/service:pattern_matcher_gmock",
648648
"//xla/tsl/lib/core:status_test_util",
649649
"@com_google_googletest//:gtest",
650650
"@local_tsl//tsl/platform:test_main",
@@ -729,9 +729,9 @@ xla_cc_test(
729729
"//xla:util",
730730
"//xla/hlo/ir:hlo",
731731
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
732+
"//xla/hlo/testlib:pattern_matcher_gmock",
732733
"//xla/service:host_memory_offload_annotations_hdr",
733734
"//xla/service:pattern_matcher",
734-
"//xla/service:pattern_matcher_gmock",
735735
"//xla/tsl/lib/core:status_test_util",
736736
"@com_google_absl//absl/container:flat_hash_set",
737737
"@com_google_absl//absl/status",
@@ -790,12 +790,12 @@ xla_cc_test(
790790
"//xla:util",
791791
"//xla/hlo/ir:hlo",
792792
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
793+
"//xla/hlo/testlib:pattern_matcher_gmock",
793794
"//xla/hlo/testlib:verified_hlo_module",
794795
"//xla/service:hlo_verifier",
795796
"//xla/service:host_memory_offload_annotations_hdr",
796797
"//xla/service:host_offload_utils",
797798
"//xla/service:pattern_matcher",
798-
"//xla/service:pattern_matcher_gmock",
799799
"//xla/tsl/lib/core:status_test_util",
800800
"@com_google_absl//absl/container:flat_hash_set",
801801
"@com_google_absl//absl/log",
@@ -925,11 +925,11 @@ xla_cc_test(
925925
srcs = ["expanders/dynamic_index_splitter_test.cc"],
926926
deps = [
927927
":dynamic_index_splitter",
928-
"//xla:test",
929-
"//xla:test_helpers",
930928
"//xla:xla_proto_cc",
931929
"//xla/hlo/ir:hlo",
932930
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
931+
"//xla/hlo/testlib:test",
932+
"//xla/hlo/testlib:test_helpers",
933933
"//xla/hlo/utils:hlo_matchers",
934934
"@com_google_googletest//:gtest",
935935
"@local_tsl//tsl/platform:test_main",
@@ -1094,9 +1094,9 @@ xla_cc_test(
10941094
"//xla:xla_data_proto_cc",
10951095
"//xla/hlo/ir:hlo",
10961096
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
1097+
"//xla/hlo/testlib:pattern_matcher_gmock",
10971098
"//xla/hlo/testlib:verified_hlo_module",
10981099
"//xla/service:pattern_matcher",
1099-
"//xla/service:pattern_matcher_gmock",
11001100
"//xla/tsl/lib/core:status_test_util",
11011101
"@com_google_absl//absl/strings",
11021102
"@com_google_absl//absl/strings:string_view",

third_party/xla/xla/hlo/transforms/bfloat16_propagation_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ limitations under the License.
2828
#include "xla/hlo/ir/hlo_module.h"
2929
#include "xla/hlo/ir/hlo_opcode.h"
3030
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
31+
#include "xla/hlo/testlib/test.h"
32+
#include "xla/hlo/testlib/test_helpers.h"
3133
#include "xla/literal_util.h"
3234
#include "xla/service/float_support.h"
3335
#include "xla/service/hlo_verifier.h"
3436
#include "xla/shape.h"
3537
#include "xla/shape_util.h"
36-
#include "xla/test.h"
37-
#include "xla/test_helpers.h"
3838
#include "xla/tests/literal_test_util.h"
3939
#include "xla/xla_data.pb.h"
4040
#include "tsl/platform/statusor.h"

third_party/xla/xla/hlo/transforms/expanders/convolution_4d_expander_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ limitations under the License.
2323
#include "xla/hlo/ir/hlo_instruction.h"
2424
#include "xla/hlo/ir/hlo_opcode.h"
2525
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
26-
#include "xla/test.h"
26+
#include "xla/hlo/testlib/test.h"
2727
#include "tsl/platform/statusor.h"
2828

2929
namespace xla {

third_party/xla/xla/hlo/transforms/expanders/convolution_pred_expander_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ limitations under the License.
2222
#include <gtest/gtest.h>
2323
#include "xla/hlo/ir/hlo_module.h"
2424
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
25+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
2526
#include "xla/service/pattern_matcher.h"
26-
#include "xla/service/pattern_matcher_gmock.h"
2727
#include "xla/xla_data.pb.h"
2828
#include "tsl/platform/statusor.h"
2929

third_party/xla/xla/hlo/transforms/expanders/dot_decomposer_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ limitations under the License.
2626
#include "xla/hlo/ir/hlo_module.h"
2727
#include "xla/hlo/ir/hlo_opcode.h"
2828
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
29+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
2930
#include "xla/hlo/utils/hlo_matchers.h"
3031
#include "xla/service/pattern_matcher.h"
31-
#include "xla/service/pattern_matcher_gmock.h"
3232
#include "tsl/platform/statusor.h"
3333
#include "tsl/platform/test.h"
3434

third_party/xla/xla/hlo/transforms/expanders/dynamic_index_splitter_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ limitations under the License.
2020
#include "xla/hlo/ir/hlo_instruction.h"
2121
#include "xla/hlo/ir/hlo_opcode.h"
2222
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
23+
#include "xla/hlo/testlib/test.h"
24+
#include "xla/hlo/testlib/test_helpers.h"
2325
#include "xla/hlo/utils/hlo_matchers.h"
24-
#include "xla/test.h"
25-
#include "xla/test_helpers.h"
2626
#include "xla/xla.pb.h"
2727

2828
namespace xla {

third_party/xla/xla/hlo/transforms/expanders/logistic_expander_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ limitations under the License.
2424
#include "xla/hlo/ir/hlo_opcode.h"
2525
#include "xla/hlo/parser/hlo_parser.h"
2626
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
27+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
28+
#include "xla/hlo/testlib/test.h"
2729
#include "xla/service/dynamic_padder.h"
2830
#include "xla/service/pattern_matcher.h"
29-
#include "xla/service/pattern_matcher_gmock.h"
30-
#include "xla/test.h"
3131
#include "xla/xla_data.pb.h"
3232
#include "tsl/platform/statusor.h"
3333

third_party/xla/xla/hlo/transforms/expanders/real_imag_expander_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ limitations under the License.
2121
#include "xla/hlo/ir/hlo_computation.h"
2222
#include "xla/hlo/ir/hlo_instruction.h"
2323
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
24+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
25+
#include "xla/hlo/testlib/test.h"
2426
#include "xla/hlo/utils/hlo_matchers.h"
2527
#include "xla/literal.h"
2628
#include "xla/service/hlo_creation_utils.h"
2729
#include "xla/service/pattern_matcher.h"
28-
#include "xla/service/pattern_matcher_gmock.h"
2930
#include "xla/shape_util.h"
30-
#include "xla/test.h"
3131
#include "xla/tsl/lib/core/status_test_util.h"
3232
#include "xla/types.h"
3333

third_party/xla/xla/hlo/transforms/expanders/reduce_decomposer_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ limitations under the License.
1919
#include <gtest/gtest.h>
2020
#include "xla/hlo/parser/hlo_parser.h"
2121
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
22-
#include "xla/test.h"
23-
#include "xla/test_helpers.h"
22+
#include "xla/hlo/testlib/test.h"
23+
#include "xla/hlo/testlib/test_helpers.h"
2424

2525
namespace xla {
2626
namespace {

third_party/xla/xla/hlo/transforms/expanders/reshape_decomposer_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ limitations under the License.
2121
#include "absl/strings/string_view.h"
2222
#include "xla/hlo/parser/hlo_parser.h"
2323
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
24-
#include "xla/test.h"
25-
#include "xla/test_helpers.h"
24+
#include "xla/hlo/testlib/test.h"
25+
#include "xla/hlo/testlib/test_helpers.h"
2626

2727
namespace xla {
2828
namespace {

third_party/xla/xla/hlo/transforms/expanders/stable_sort_expander_test.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ limitations under the License.
2020
#include <gtest/gtest.h>
2121
#include "xla/hlo/parser/hlo_parser.h"
2222
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
23+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
24+
#include "xla/hlo/testlib/test.h"
2325
#include "xla/hlo/transforms/simplifiers/algebraic_simplifier.h"
2426
#include "xla/hlo/utils/hlo_matchers.h"
2527
#include "xla/service/pattern_matcher.h"
26-
#include "xla/service/pattern_matcher_gmock.h"
27-
#include "xla/test.h"
2828
#include "xla/tsl/lib/core/status_test_util.h"
2929

3030
namespace xla {

third_party/xla/xla/hlo/transforms/host_offload_legalize_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ limitations under the License.
2626
#include "xla/hlo/ir/hlo_module.h"
2727
#include "xla/hlo/ir/hlo_opcode.h"
2828
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
29+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
2930
#include "xla/service/host_memory_offload_annotations.h"
3031
#include "xla/service/pattern_matcher.h"
31-
#include "xla/service/pattern_matcher_gmock.h"
3232
#include "xla/shape.h"
3333
#include "xla/shape_util.h"
3434
#include "xla/tsl/lib/core/status_test_util.h"

third_party/xla/xla/hlo/transforms/host_offloader_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ limitations under the License.
3131
#include "xla/hlo/ir/hlo_module.h"
3232
#include "xla/hlo/ir/hlo_opcode.h"
3333
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
34+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
3435
#include "xla/hlo/testlib/verified_hlo_module.h"
3536
#include "xla/hlo/transforms/host_offload_legalize.h"
3637
#include "xla/layout.h"
3738
#include "xla/service/hlo_verifier.h"
3839
#include "xla/service/host_memory_offload_annotations.h"
3940
#include "xla/service/host_offload_utils.h"
4041
#include "xla/service/pattern_matcher.h"
41-
#include "xla/service/pattern_matcher_gmock.h"
4242
#include "xla/shape.h"
4343
#include "xla/shape_util.h"
4444
#include "xla/tsl/lib/core/status_test_util.h"

third_party/xla/xla/hlo/transforms/while_loop_trip_count_annotator_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717

1818
#include <gtest/gtest.h>
1919
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
20-
#include "xla/test.h"
20+
#include "xla/hlo/testlib/test.h"
2121
#include "xla/xla_data.pb.h"
2222
#include "tsl/platform/statusor.h"
2323

0 commit comments

Comments
 (0)