[memprof] Upgrade a unit test to MemProf Version 3 (#117063)
[llvm-project.git] / utils / bazel / llvm-project-overlay / mlir / test / BUILD.bazel
blobc69f793943beeca58a79b64e99067ae2c45e461e
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
6 load("//llvm:lit_test.bzl", "package_path")
7 load("//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_sharded_ops", "td_library")
9 package(
10     default_visibility = ["//visibility:public"],
11     features = ["layering_check"],
14 licenses(["notice"])
16 LLVM_LIT_PATH_FUNCTION = " " + \
17                          "# Allow generated file to be relocatable.\n" + \
18                          "from pathlib import Path\n" + \
19                          "def path(p):\n" + \
20                          "    if not p: return ''\n" + \
21                          "    return str((Path(__file__).parent / p).resolve())\n"
23 LIT_SITE_CFG_IN_HEADER = "# Autogenerated, do not edit." + LLVM_LIT_PATH_FUNCTION
25 expand_template(
26     name = "lit_site_cfg_py",
27     testonly = True,
28     out = "lit.site.cfg.py",
29     substitutions = {
30         "@LIT_SITE_CFG_IN_HEADER@": LIT_SITE_CFG_IN_HEADER,
31         "@LLVM_TOOLS_DIR@": package_path("//llvm:BUILD"),
32         "@ENABLE_SHARED@": "1",
33         "@ENABLE_ASSERTIONS@": "1",
34         "@MLIR_SOURCE_DIR@": package_path("//mlir:BUILD"),
35         "@MLIR_TOOLS_DIR@": package_path("//mlir:BUILD"),
36         "\"@MLIR_BINARY_DIR@\"": "os.environ[\"TEST_UNDECLARED_OUTPUTS_DIR\"]",
37         # All disabled, but required to substituted because they are not in quotes.
38         "@LLVM_BUILD_EXAMPLES@": "0",
39         "@LLVM_HAS_NVPTX_TARGET@": "0",
40         "@MLIR_ENABLE_CUDA_RUNNER@": "0",
41         "@MLIR_ENABLE_ROCM_CONVERSIONS@": "0",
42         "@MLIR_ENABLE_ROCM_RUNNER@": "0",
43         "@MLIR_ENABLE_SYCL_RUNNER@": "0",
44         "@MLIR_ENABLE_SPIRV_CPU_RUNNER@": "0",
45         "@MLIR_ENABLE_VULKAN_RUNNER@": "0",
46         "@MLIR_ENABLE_BINDINGS_PYTHON@": "0",
47         "@MLIR_RUN_AMX_TESTS@": "0",
48         "@MLIR_RUN_ARM_SVE_TESTS@": "0",
49         "@MLIR_RUN_ARM_SME_TESTS@": "0",
50         "@MLIR_RUN_X86VECTOR_TESTS@": "0",
51         "@MLIR_RUN_CUDA_TENSOR_CORE_TESTS@": "0",
52         "@MLIR_RUN_CUDA_SM80_TESTS@": "0",
53         "@MLIR_RUN_CUDA_SM80_LT_TESTS@": "0",
54         "@MLIR_RUN_CUDA_SM90_TESTS@": "0",
55         "@MLIR_INCLUDE_INTEGRATION_TESTS@": "0",
56         "@SHLIBDIR@": package_path("//llvm:BUILD"),
57     },
58     template = "lit.site.cfg.py.in",
61 # Common data used by most lit tests.
62 filegroup(
63     name = "lit_data",
64     testonly = True,
65     data = [
66         "lit.cfg.py",
67         "lit.site.cfg.py",
68         "//llvm:FileCheck",
69         "//llvm:count",
70         "//llvm:not",
71     ],
74 cc_library(
75     name = "IRProducingAPITest",
76     hdrs = ["APITest.h"],
77     includes = ["."],
80 cc_library(
81     name = "TestAnalysis",
82     srcs = glob(
83         [
84             "lib/Analysis/*.cpp",
85             "lib/Analysis/*.h",
86             "lib/Analysis/DataFlow/*.cpp",
87             "lib/Analysis/DataFlow/*.h",
88         ],
89     ),
90     includes = ["lib/Dialect/Test"],
91     deps = [
92         ":TestDialect",
93         "//llvm:Support",
94         "//mlir:AffineAnalysis",
95         "//mlir:AffineDialect",
96         "//mlir:Analysis",
97         "//mlir:CallOpInterfaces",
98         "//mlir:ControlFlowInterfaces",
99         "//mlir:FuncDialect",
100         "//mlir:FunctionInterfaces",
101         "//mlir:IR",
102         "//mlir:MemRefDialect",
103         "//mlir:Pass",
104         "//mlir:SideEffectInterfaces",
105         "//mlir:Support",
106     ],
109 td_library(
110     name = "TestOpTdFiles",
111     srcs = glob(["lib/Dialect/Test/*.td"]),
112     deps = [
113         "//mlir:BuiltinDialectTdFiles",
114         "//mlir:CallInterfacesTdFiles",
115         "//mlir:ControlFlowInterfacesTdFiles",
116         "//mlir:CopyOpInterfaceTdFiles",
117         "//mlir:DLTIDialectTdFiles",
118         "//mlir:DataLayoutInterfacesTdFiles",
119         "//mlir:DestinationStyleOpInterfaceTdFiles",
120         "//mlir:FunctionInterfacesTdFiles",
121         "//mlir:InferIntRangeInterfaceTdFiles",
122         "//mlir:InferTypeOpInterfaceTdFiles",
123         "//mlir:LinalgStructuredOpsTdFiles",
124         "//mlir:MemorySlotInterfacesTdFiles",
125         "//mlir:OpBaseTdFiles",
126         "//mlir:PolynomialTdFiles",
127         "//mlir:SideEffectInterfacesTdFiles",
128     ],
131 gentbl_cc_library(
132     name = "TestOpsSyntaxIncGen",
133     strip_include_prefix = "lib/Dialect/Test",
134     tbl_outs = [
135         (
136             ["-gen-op-decls"],
137             "lib/Dialect/Test/TestOpsSyntax.h.inc",
138         ),
139         (
140             ["-gen-op-defs"],
141             "lib/Dialect/Test/TestOpsSyntax.cpp.inc",
142         ),
143     ],
144     tblgen = "//mlir:mlir-tblgen",
145     td_file = "lib/Dialect/Test/TestOpsSyntax.td",
146     test = True,
147     deps = [
148         ":TestOpTdFiles",
149     ],
152 gentbl_cc_library(
153     name = "TestOpsIncGen",
154     strip_include_prefix = "lib/Dialect/Test",
155     tbl_outs = [
156         (
157             [
158                 "-gen-dialect-decls",
159                 "-dialect=test",
160             ],
161             "lib/Dialect/Test/TestOpsDialect.h.inc",
162         ),
163         (
164             [
165                 "-gen-dialect-defs",
166                 "-dialect=test",
167             ],
168             "lib/Dialect/Test/TestOpsDialect.cpp.inc",
169         ),
170         (
171             ["-gen-rewriters"],
172             "lib/Dialect/Test/TestPatterns.inc",
173         ),
174     ],
175     tblgen = "//mlir:mlir-tblgen",
176     td_file = "lib/Dialect/Test/TestOps.td",
177     test = True,
178     deps = [
179         ":TestOpTdFiles",
180     ],
183 gentbl_cc_library(
184     name = "TestInterfacesIncGen",
185     strip_include_prefix = "lib/Dialect/Test",
186     tbl_outs = [
187         (
188             ["-gen-attr-interface-decls"],
189             "lib/Dialect/Test/TestAttrInterfaces.h.inc",
190         ),
191         (
192             ["-gen-attr-interface-defs"],
193             "lib/Dialect/Test/TestAttrInterfaces.cpp.inc",
194         ),
195         (
196             ["-gen-type-interface-decls"],
197             "lib/Dialect/Test/TestTypeInterfaces.h.inc",
198         ),
199         (
200             ["-gen-type-interface-defs"],
201             "lib/Dialect/Test/TestTypeInterfaces.cpp.inc",
202         ),
203         (
204             ["-gen-op-interface-decls"],
205             "lib/Dialect/Test/TestOpInterfaces.h.inc",
206         ),
207         (
208             ["-gen-op-interface-defs"],
209             "lib/Dialect/Test/TestOpInterfaces.cpp.inc",
210         ),
211     ],
212     tblgen = "//mlir:mlir-tblgen",
213     td_file = "lib/Dialect/Test/TestInterfaces.td",
214     test = True,
215     deps = [
216         "//mlir:OpBaseTdFiles",
217         "//mlir:SideEffectInterfacesTdFiles",
218     ],
221 gentbl_cc_library(
222     name = "TestAttrDefsIncGen",
223     strip_include_prefix = "lib/Dialect/Test",
224     tbl_outs = [
225         (
226             [
227                 "-gen-attrdef-decls",
228                 "--attrdefs-dialect=test",
229             ],
230             "lib/Dialect/Test/TestAttrDefs.h.inc",
231         ),
232         (
233             [
234                 "-gen-attrdef-defs",
235                 "--attrdefs-dialect=test",
236             ],
237             "lib/Dialect/Test/TestAttrDefs.cpp.inc",
238         ),
239     ],
240     tblgen = "//mlir:mlir-tblgen",
241     td_file = "lib/Dialect/Test/TestOps.td",
242     test = True,
243     deps = [
244         ":TestOpTdFiles",
245     ],
248 gentbl_cc_library(
249     name = "TestEnumDefsIncGen",
250     strip_include_prefix = "lib/Dialect/Test",
251     tbl_outs = [
252         (
253             ["-gen-enum-decls"],
254             "lib/Dialect/Test/TestOpEnums.h.inc",
255         ),
256         (
257             ["-gen-enum-defs"],
258             "lib/Dialect/Test/TestOpEnums.cpp.inc",
259         ),
260     ],
261     tblgen = "//mlir:mlir-tblgen",
262     td_file = "lib/Dialect/Test/TestEnumDefs.td",
263     test = True,
264     deps = [
265         ":TestOpTdFiles",
266     ],
269 gentbl_cc_library(
270     name = "TestTypeDefsIncGen",
271     strip_include_prefix = "lib/Dialect/Test",
272     tbl_outs = [
273         (
274             [
275                 "-gen-typedef-decls",
276                 "--typedefs-dialect=test",
277             ],
278             "lib/Dialect/Test/TestTypeDefs.h.inc",
279         ),
280         (
281             [
282                 "-gen-typedef-defs",
283                 "--typedefs-dialect=test",
284             ],
285             "lib/Dialect/Test/TestTypeDefs.cpp.inc",
286         ),
287     ],
288     tblgen = "//mlir:mlir-tblgen",
289     td_file = "lib/Dialect/Test/TestTypeDefs.td",
290     test = True,
291     deps = [
292         ":TestOpTdFiles",
293         "//mlir:BuiltinDialectTdFiles",
294     ],
297 cc_library(
298     name = "TestTestDynDialect",
299     srcs = glob([
300         "lib/Dialect/TestDyn/*.cpp",
301     ]),
302     deps = [
303         "//mlir:IR",
304     ],
307 td_library(
308     name = "TransformDialectTdFiles",
309     srcs = glob(["lib/Dialect/Transform/*.td"]),
310     deps = [
311         "//mlir:OpBaseTdFiles",
312     ],
315 gentbl_cc_library(
316     name = "TestTransformDialectExtensionIncGen",
317     strip_include_prefix = "lib/Dialect/Transform",
318     tbl_outs = [
319         (
320             ["-gen-op-decls"],
321             "lib/Dialect/Transform/TestTransformDialectExtension.h.inc",
322         ),
323         (
324             ["-gen-op-defs"],
325             "lib/Dialect/Transform/TestTransformDialectExtension.cpp.inc",
326         ),
327         (
328             [
329                 "-gen-typedef-decls",
330                 "-typedefs-dialect=transform",
331             ],
332             "lib/Dialect/Transform/TestTransformDialectExtensionTypes.h.inc",
333         ),
334         (
335             [
336                 "-gen-typedef-defs",
337                 "-typedefs-dialect=transform",
338             ],
339             "lib/Dialect/Transform/TestTransformDialectExtensionTypes.cpp.inc",
340         ),
341     ],
342     tblgen = "//mlir:mlir-tblgen",
343     td_file = "lib/Dialect/Transform/TestTransformDialectExtension.td",
344     test = True,
345     deps = [
346         ":TransformDialectTdFiles",
347         "//mlir:PDLDialectTdFiles",
348         "//mlir:TransformDialectTdFiles",
349         "//mlir:TransformPDLExtension",
350     ],
353 cc_library(
354     name = "TestTransformDialect",
355     srcs = glob(["lib/Dialect/Transform/*.cpp"]),
356     hdrs = glob(["lib/Dialect/Transform/*.h"]),
357     includes = ["lib/Dialect/Transform"],
358     deps = [
359         ":TestTransformDialectExtensionIncGen",
360         "//llvm:Support",
361         "//mlir:BytecodeOpInterface",
362         "//mlir:IR",
363         "//mlir:PDLDialect",
364         "//mlir:Pass",
365         "//mlir:TransformDebugExtension",
366         "//mlir:TransformDialect",
367         "//mlir:TransformDialectInterfaces",
368         "//mlir:TransformDialectTransforms",
369         "//mlir:TransformPDLExtension",
370     ],
373 gentbl_sharded_ops(
374     name = "TestDialectOpSrcs",
375     hdr_out = "lib/Dialect/Test/TestOps.h.inc",
376     shard_count = 20,
377     sharder = "//mlir:mlir-src-sharder",
378     src_file = "lib/Dialect/Test/TestOps.cpp",
379     src_out = "lib/Dialect/Test/TestOps.cpp.inc",
380     tblgen = "//mlir:mlir-tblgen",
381     td_file = "lib/Dialect/Test/TestOps.td",
382     test = True,
383     deps = [":TestOpTdFiles"],
386 cc_library(
387     name = "TestDialect",
388     srcs = glob(
389         ["lib/Dialect/Test/*.cpp"],
390         exclude = ["lib/Dialect/Test/TestToLLVMIRTranslation.cpp"],
391     ) + [":TestDialectOpSrcs"],
392     hdrs = glob(["lib/Dialect/Test/*.h"]),
393     includes = [
394         "lib/Dialect/Test",
395     ],
396     deps = [
397         ":TestAttrDefsIncGen",
398         ":TestEnumDefsIncGen",
399         ":TestInterfacesIncGen",
400         ":TestOpsIncGen",
401         ":TestOpsSyntaxIncGen",
402         ":TestTypeDefsIncGen",
403         "//llvm:Core",
404         "//llvm:IRReader",
405         "//llvm:Support",
406         "//mlir:ArithDialect",
407         "//mlir:BytecodeOpInterface",
408         "//mlir:CallOpInterfaces",
409         "//mlir:ControlFlowInterfaces",
410         "//mlir:CopyOpInterface",
411         "//mlir:DLTIDialect",
412         "//mlir:DataLayoutInterfaces",
413         "//mlir:DerivedAttributeOpInterface",
414         "//mlir:DestinationStyleOpInterface",
415         "//mlir:Dialect",
416         "//mlir:DialectUtils",
417         "//mlir:FromLLVMIRTranslation",
418         "//mlir:FuncDialect",
419         "//mlir:FuncTransforms",
420         "//mlir:FunctionInterfaces",
421         "//mlir:IR",
422         "//mlir:InferIntRangeInterface",
423         "//mlir:InferTypeOpInterface",
424         "//mlir:InliningUtils",
425         "//mlir:LLVMDialect",
426         "//mlir:LLVMIRToLLVMTranslation",
427         "//mlir:LinalgDialect",
428         "//mlir:LoopLikeInterface",
429         "//mlir:MemorySlotInterfaces",
430         "//mlir:Pass",
431         "//mlir:PolynomialDialect",
432         "//mlir:Reducer",
433         "//mlir:SideEffectInterfaces",
434         "//mlir:Support",
435         "//mlir:TensorDialect",
436         "//mlir:TransformUtils",
437         "//mlir:Transforms",
438         "//mlir:TranslateLib",
439         "//mlir:ValueBoundsOpInterface",
440         "//mlir:ViewLikeInterface",
441     ],
444 cc_library(
445     name = "TestToLLVMIRTranslation",
446     srcs = ["lib/Dialect/Test/TestToLLVMIRTranslation.cpp"],
447     deps = [
448         ":TestDialect",
449         "//llvm:Core",
450         "//llvm:Support",
451         "//mlir:BuiltinToLLVMIRTranslation",
452         "//mlir:IR",
453         "//mlir:LLVMToLLVMIRTranslation",
454         "//mlir:ToLLVMIRTranslation",
455         "//mlir:TranslateLib",
456     ],
459 cc_library(
460     name = "TestIR",
461     srcs = glob(["lib/IR/*.cpp"]),
462     deps = [
463         ":TestDialect",
464         "//llvm:Support",
465         "//mlir:Analysis",
466         "//mlir:ArithDialect",
467         "//mlir:BytecodeOpInterface",
468         "//mlir:BytecodeReader",
469         "//mlir:BytecodeWriter",
470         "//mlir:FuncDialect",
471         "//mlir:FunctionInterfaces",
472         "//mlir:IR",
473         "//mlir:LinalgDialect",
474         "//mlir:Parser",
475         "//mlir:Pass",
476         "//mlir:Support",
477     ],
480 cc_library(
481     name = "TestLoopLikeInterface",
482     srcs = glob(["lib/Interfaces/LoopLikeInterface/*.cpp"]),
483     deps = [
484         "//llvm:Support",
485         "//mlir:FuncDialect",
486         "//mlir:IR",
487         "//mlir:LoopLikeInterface",
488         "//mlir:Pass",
489     ],
492 gentbl_cc_library(
493     name = "TestTilingInterfaceTransformOpsIncGen",
494     includes = ["lib/Interfaces/TilingInterface"],
495     strip_include_prefix = "lib",
496     tbl_outs = [
497         (
498             ["-gen-op-decls"],
499             "lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.h.inc",
500         ),
501         (
502             ["-gen-op-defs"],
503             "lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp.inc",
504         ),
505     ],
506     tblgen = "//mlir:mlir-tblgen",
507     td_file = "lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.td",
508     deps = [
509         "//mlir:SCFTdFiles",
510         "//mlir:TransformDialectTdFiles",
511     ],
514 cc_library(
515     name = "TestTilingInterface",
516     srcs = glob(["lib/Interfaces/TilingInterface/*.cpp"]),
517     includes = ["lib/Interfaces/TilingInterface"],
518     deps = [
519         ":TestTilingInterfaceTransformOpsIncGen",
520         "//llvm:Support",
521         "//mlir:AffineDialect",
522         "//mlir:ArithDialect",
523         "//mlir:DialectUtils",
524         "//mlir:FuncDialect",
525         "//mlir:GPUDialect",
526         "//mlir:IR",
527         "//mlir:IndexDialect",
528         "//mlir:LinalgDialect",
529         "//mlir:LinalgTransforms",
530         "//mlir:MemRefDialect",
531         "//mlir:Pass",
532         "//mlir:SCFDialect",
533         "//mlir:SCFTransforms",
534         "//mlir:TensorDialect",
535         "//mlir:TensorTilingInterfaceImpl",
536         "//mlir:TilingInterface",
537         "//mlir:TransformDialect",
538         "//mlir:TransformDialectInterfaces",
539         "//mlir:Transforms",
540     ],
543 cc_library(
544     name = "TestPass",
545     srcs = glob(["lib/Pass/*.cpp"]),
546     deps = [
547         ":TestDialect",
548         "//llvm:Support",
549         "//mlir:FuncDialect",
550         "//mlir:GPUToSPIRV",
551         "//mlir:GPUTransforms",
552         "//mlir:IR",
553         "//mlir:Pass",
554         "//mlir:SPIRVDialect",
555         "//mlir:SPIRVToLLVM",
556         "//mlir:SPIRVTransforms",
557         "//mlir:Support",
558     ],
561 cc_library(
562     name = "TestRewrite",
563     srcs = [
564         "lib/Rewrite/TestPDLByteCode.cpp",
565     ],
566     deps = [
567         "//mlir:IR",
568         "//mlir:PDLInterpDialect",
569         "//mlir:Pass",
570         "//mlir:Support",
571         "//mlir:TransformUtils",
572         "//mlir:Transforms",
573     ],
576 cc_library(
577     name = "TestReducer",
578     srcs = [
579         "lib/Reducer/MLIRTestReducer.cpp",
580     ],
581     deps = [
582         "//mlir:IR",
583         "//mlir:Pass",
584         "//mlir:Support",
585     ],
588 cc_library(
589     name = "TestTransforms",
590     srcs = glob(["lib/Transforms/*.cpp"]),
591     includes = ["lib/Dialect/Test"],
592     deps = [
593         ":TestDialect",
594         ":TestDialectConversionPDLLPatternsIncGen",
595         "//llvm:Support",
596         "//mlir:AffineAnalysis",
597         "//mlir:AffineDialect",
598         "//mlir:Analysis",
599         "//mlir:ArithDialect",
600         "//mlir:FuncDialect",
601         "//mlir:IR",
602         "//mlir:InliningUtils",
603         "//mlir:MathDialect",
604         "//mlir:PDLDialect",
605         "//mlir:PDLInterpDialect",
606         "//mlir:Parser",
607         "//mlir:Pass",
608         "//mlir:SCFDialect",
609         "//mlir:SPIRVDialect",
610         "//mlir:SideEffectInterfaces",
611         "//mlir:Support",
612         "//mlir:TransformUtils",
613         "//mlir:Transforms",
614     ],
617 cc_library(
618     name = "TestFuncToLLVM",
619     srcs = glob(["lib/Conversion/FuncToLLVM/*.cpp"]),
620     includes = ["lib/Dialect/Test"],
621     deps = [
622         ":TestDialect",
623         "//mlir:FuncDialect",
624         "//mlir:FuncToLLVM",
625         "//mlir:IR",
626         "//mlir:LLVMCommonConversion",
627         "//mlir:LLVMDialect",
628         "//mlir:Pass",
629     ],
632 cc_library(
633     name = "TestOneToNTypeConversion",
634     srcs = glob(["lib/Conversion/OneToNTypeConversion/*.cpp"]),
635     includes = ["lib/Dialect/Test"],
636     deps = [
637         ":TestDialect",
638         "//mlir:FuncDialect",
639         "//mlir:FuncTransforms",
640         "//mlir:IR",
641         "//mlir:Pass",
642         "//mlir:SCFDialect",
643         "//mlir:SCFTransforms",
644         "//mlir:TransformUtils",
645         "//mlir:Transforms",
646     ],
649 cc_library(
650     name = "TestVectorToSPIRV",
651     srcs = glob(["lib/Conversion/VectorToSPIRV/*.cpp"]),
652     deps = [
653         "//mlir:ArithDialect",
654         "//mlir:FuncDialect",
655         "//mlir:Pass",
656         "//mlir:SPIRVDialect",
657         "//mlir:TransformUtils",
658         "//mlir:Transforms",
659         "//mlir:VectorDialect",
660         "//mlir:VectorToSPIRV",
661     ],
664 cc_library(
665     name = "TestConvertToSPIRV",
666     srcs = glob(["lib/Conversion/ConvertToSPIRV/*.cpp"]),
667     deps = [
668         "//mlir:ArithDialect",
669         "//mlir:FuncDialect",
670         "//mlir:Pass",
671         "//mlir:SPIRVConversion",
672         "//mlir:SPIRVDialect",
673         "//mlir:TransformUtils",
674         "//mlir:Transforms",
675         "//mlir:VectorDialect",
676         "//mlir:VectorTransforms",
677     ],
680 cc_library(
681     name = "TestAffine",
682     srcs = glob([
683         "lib/Dialect/Affine/*.cpp",
684     ]),
685     deps = [
686         ":TestDialect",
687         "//llvm:Support",
688         "//mlir:AffineAnalysis",
689         "//mlir:AffineDialect",
690         "//mlir:AffineTransforms",
691         "//mlir:AffineUtils",
692         "//mlir:Analysis",
693         "//mlir:ArithTransforms",
694         "//mlir:DialectUtils",
695         "//mlir:FuncDialect",
696         "//mlir:IR",
697         "//mlir:MemRefDialect",
698         "//mlir:Pass",
699         "//mlir:SCFDialect",
700         "//mlir:Support",
701         "//mlir:TensorDialect",
702         "//mlir:TransformUtils",
703         "//mlir:Transforms",
704         "//mlir:ValueBoundsOpInterface",
705         "//mlir:VectorDialect",
706         "//mlir:VectorUtils",
707     ],
710 cc_library(
711     name = "TestDLTI",
712     srcs = glob(["lib/Dialect/DLTI/*.cpp"]),
713     includes = ["lib/Dialect/Test"],
714     deps = [
715         ":TestDialect",
716         "//mlir:Analysis",
717         "//mlir:DLTIDialect",
718         "//mlir:IR",
719         "//mlir:Pass",
720     ],
723 cc_library(
724     name = "TestGPU",
725     srcs = glob(["lib/Dialect/GPU/*.cpp"]),
726     includes = ["lib/Dialect/Test"],
727     deps = [
728         "//llvm:NVPTXCodeGen",
729         "//llvm:Support",
730         "//mlir:AffineDialect",
731         "//mlir:AffineToStandard",
732         "//mlir:ArithDialect",
733         "//mlir:ArithToLLVM",
734         "//mlir:FuncDialect",
735         "//mlir:FuncToLLVM",
736         "//mlir:GPUDialect",
737         "//mlir:GPUToGPURuntimeTransforms",
738         "//mlir:GPUToNVVMTransforms",
739         "//mlir:GPUTransforms",
740         "//mlir:IR",
741         "//mlir:IndexDialect",
742         "//mlir:IndexToLLVM",
743         "//mlir:LLVMDialect",
744         "//mlir:LinalgTransforms",
745         "//mlir:MathToLLVM",
746         "//mlir:MemRefDialect",
747         "//mlir:MemRefToLLVM",
748         "//mlir:MemRefTransforms",
749         "//mlir:NVGPUToNVVM",
750         "//mlir:NVVMToLLVM",
751         "//mlir:NVVMToLLVMIRTranslation",
752         "//mlir:Pass",
753         "//mlir:ROCDLToLLVMIRTranslation",
754         "//mlir:ReconcileUnrealizedCasts",
755         "//mlir:SCFDialect",
756         "//mlir:SCFToControlFlow",
757         "//mlir:SPIRVDialect",
758         "//mlir:ToLLVMIRTranslation",
759         "//mlir:TransformUtils",
760         "//mlir:Transforms",
761         "//mlir:VectorDialect",
762         "//mlir:VectorToLLVM",
763         "//mlir:VectorToSCF",
764     ],
767 cc_library(
768     name = "TestLinalg",
769     srcs = glob(["lib/Dialect/Linalg/*.cpp"]),
770     includes = ["lib/Dialect/Test"],
771     deps = [
772         "//llvm:Support",
773         "//mlir:AffineDialect",
774         "//mlir:ArithDialect",
775         "//mlir:ArithTransforms",
776         "//mlir:BufferizationDialect",
777         "//mlir:BufferizationTransforms",
778         "//mlir:FuncDialect",
779         "//mlir:FuncTransforms",
780         "//mlir:GPUDialect",
781         "//mlir:IR",
782         "//mlir:LinalgDialect",
783         "//mlir:LinalgTransforms",
784         "//mlir:LinalgUtils",
785         "//mlir:MemRefDialect",
786         "//mlir:Parser",
787         "//mlir:Pass",
788         "//mlir:SCFDialect",
789         "//mlir:SCFTransforms",
790         "//mlir:TensorDialect",
791         "//mlir:TensorTransforms",
792         "//mlir:TransformUtils",
793         "//mlir:Transforms",
794         "//mlir:VectorDialect",
795         "//mlir:VectorToSCF",
796         "//mlir:VectorTransforms",
797     ],
800 cc_library(
801     name = "TestLLVM",
802     srcs = glob(["lib/Dialect/LLVM/*.cpp"]),
803     includes = ["lib/Dialect/Test"],
804     deps = [
805         "//mlir:AffineToStandard",
806         "//mlir:FuncDialect",
807         "//mlir:FuncToLLVM",
808         "//mlir:IR",
809         "//mlir:IndexToLLVM",
810         "//mlir:LLVMDialect",
811         "//mlir:LinalgTransforms",
812         "//mlir:MathToLLVM",
813         "//mlir:MemRefToLLVM",
814         "//mlir:MemRefTransforms",
815         "//mlir:Pass",
816         "//mlir:ReconcileUnrealizedCasts",
817         "//mlir:SCFToControlFlow",
818         "//mlir:Transforms",
819         "//mlir:VectorToLLVM",
820         "//mlir:VectorToSCF",
821     ],
824 cc_library(
825     name = "TestMath",
826     srcs = glob(["lib/Dialect/Math/*.cpp"]),
827     includes = ["lib/Dialect/Test"],
828     deps = [
829         "//mlir:ArithDialect",
830         "//mlir:MathDialect",
831         "//mlir:MathTransforms",
832         "//mlir:Pass",
833         "//mlir:SCFDialect",
834         "//mlir:TransformUtils",
835         "//mlir:Transforms",
836         "//mlir:VectorDialect",
837         "//mlir:X86VectorDialect",
838     ],
841 cc_library(
842     name = "TestMathToVCIX",
843     srcs = glob(["lib/Conversion/MathToVCIX/*.cpp"]),
844     includes = ["lib/Dialect/Test"],
845     deps = [
846         "//mlir:ArithDialect",
847         "//mlir:FuncDialect",
848         "//mlir:IR",
849         "//mlir:MathDialect",
850         "//mlir:Pass",
851         "//mlir:TransformUtils",
852         "//mlir:Transforms",
853         "//mlir:VCIXDialect",
854         "//mlir:VectorDialect",
855     ],
858 cc_library(
859     name = "TestMemRef",
860     srcs = glob(["lib/Dialect/MemRef/*.cpp"]),
861     includes = ["lib/Dialect/Test"],
862     deps = [
863         ":TestDialect",
864         "//mlir:AffineDialect",
865         "//mlir:ArithDialect",
866         "//mlir:ArithTransforms",
867         "//mlir:FuncDialect",
868         "//mlir:MemRefDialect",
869         "//mlir:MemRefTransforms",
870         "//mlir:Pass",
871         "//mlir:TransformUtils",
872         "//mlir:Transforms",
873         "//mlir:VectorDialect",
874         "//mlir:VectorTransforms",
875     ],
878 cc_library(
879     name = "TestMesh",
880     srcs = glob(["lib/Dialect/Mesh/**/*.cpp"]),
881     includes = ["lib/Dialect/Test"],
882     deps = [
883         ":TestDialect",
884         "//mlir:ArithDialect",
885         "//mlir:DialectUtils",
886         "//mlir:FuncDialect",
887         "//mlir:IR",
888         "//mlir:MeshDialect",
889         "//mlir:MeshTransforms",
890         "//mlir:Pass",
891         "//mlir:SPIRVDialect",
892         "//mlir:Support",
893         "//mlir:TransformUtils",
894         "//mlir:Transforms",
895     ],
898 cc_library(
899     name = "TestNVGPU",
900     srcs = glob(["lib/Dialect/NVGPU/*.cpp"]),
901     includes = ["lib/Dialect/Test"],
902     deps = [
903         "//mlir:AffineDialect",
904         "//mlir:Analysis",
905         "//mlir:FuncDialect",
906         "//mlir:GPUDialect",
907         "//mlir:IR",
908         "//mlir:LLVMDialect",
909         "//mlir:LinalgDialect",
910         "//mlir:LinalgTransforms",
911         "//mlir:MemRefDialect",
912         "//mlir:NVGPUDialect",
913         "//mlir:NVGPUTransforms",
914         "//mlir:Pass",
915         "//mlir:SCFDialect",
916         "//mlir:Support",
917         "//mlir:TransformUtils",
918         "//mlir:Transforms",
919     ],
922 cc_library(
923     name = "TestSCF",
924     srcs = glob(["lib/Dialect/SCF/*.cpp"]),
925     includes = ["lib/Dialect/Test"],
926     deps = [
927         "//llvm:Support",
928         "//mlir:ArithDialect",
929         "//mlir:FuncDialect",
930         "//mlir:IR",
931         "//mlir:MathDialect",
932         "//mlir:MemRefDialect",
933         "//mlir:Pass",
934         "//mlir:SCFDialect",
935         "//mlir:SCFTransforms",
936         "//mlir:SCFUtils",
937         "//mlir:TransformUtils",
938         "//mlir:Transforms",
939     ],
942 cc_library(
943     name = "TestArith",
944     srcs = glob(["lib/Dialect/Arith/*.cpp"]),
945     includes = ["lib/Dialect/Test"],
946     deps = [
947         "//mlir:ArithDialect",
948         "//mlir:ArithTransforms",
949         "//mlir:FuncDialect",
950         "//mlir:LLVMDialect",
951         "//mlir:MathDialect",
952         "//mlir:Pass",
953         "//mlir:TransformUtils",
954         "//mlir:Transforms",
955         "//mlir:VectorDialect",
956     ],
959 cc_library(
960     name = "TestArmNeon",
961     srcs = glob(["lib/Dialect/ArmNeon/*.cpp"]),
962     includes = ["lib/Dialect/Test"],
963     deps = [
964         "//mlir:ArmNeonDialect",
965         "//mlir:ArmNeonTransforms",
966         "//mlir:FuncDialect",
967         "//mlir:IR",
968         "//mlir:Pass",
969         "//mlir:Support",
970         "//mlir:TransformUtils",
971         "//mlir:Transforms",
972     ],
975 cc_library(
976     name = "TestArmSME",
977     srcs = glob(["lib/Dialect/ArmSME/*.cpp"]),
978     includes = ["lib/Dialect/Test"],
979     deps = [
980         "//mlir:ArithToArmSME",
981         "//mlir:ArmSMEToLLVM",
982         "//mlir:ArmSMEToSCF",
983         "//mlir:ArmSMETransforms",
984         "//mlir:ArmSVETransforms",
985         "//mlir:FuncDialect",
986         "//mlir:IR",
987         "//mlir:Pass",
988         "//mlir:SCFToControlFlow",
989         "//mlir:Transforms",
990         "//mlir:VectorToArmSME",
991         "//mlir:VectorToSCF",
992     ],
995 cc_library(
996     name = "TestBufferization",
997     srcs = glob(["lib/Dialect/Bufferization/*.cpp"]),
998     includes = ["lib/Dialect/Test"],
999     deps = [
1000         "//mlir:BufferizationDialect",
1001         "//mlir:BufferizationTransforms",
1002         "//mlir:IR",
1003         "//mlir:Pass",
1004     ],
1007 cc_library(
1008     name = "TestControlFlow",
1009     srcs = glob(["lib/Dialect/ControlFlow/*.cpp"]),
1010     includes = ["lib/Dialect/Test"],
1011     deps = [
1012         "//mlir:ControlFlowDialect",
1013         "//mlir:ControlFlowToLLVM",
1014         "//mlir:FuncDialect",
1015         "//mlir:LLVMCommonConversion",
1016         "//mlir:LLVMDialect",
1017         "//mlir:Pass",
1018         "//mlir:TransformUtils",
1019         "//mlir:Transforms",
1020     ],
1023 cc_library(
1024     name = "TestShapeDialect",
1025     srcs = [
1026         "lib/Dialect/Shape/TestShapeFunctions.cpp",
1027         "lib/Dialect/Shape/TestShapeMappingAnalysis.cpp",
1028     ],
1029     deps = [
1030         "//llvm:Support",
1031         "//mlir:FuncDialect",
1032         "//mlir:IR",
1033         "//mlir:InferTypeOpInterface",
1034         "//mlir:Pass",
1035         "//mlir:ShapeDialect",
1036         "//mlir:ShapeTransforms",
1037     ],
1040 cc_library(
1041     name = "TestSPIRV",
1042     srcs = glob([
1043         "lib/Dialect/SPIRV/*.cpp",
1044     ]),
1045     deps = [
1046         "//mlir:FuncDialect",
1047         "//mlir:GPUDialect",
1048         "//mlir:IR",
1049         "//mlir:Pass",
1050         "//mlir:SPIRVConversion",
1051         "//mlir:SPIRVDialect",
1052         "//mlir:SPIRVModuleCombiner",
1053         "//mlir:Transforms",
1054     ],
1057 cc_library(
1058     name = "TestFunc",
1059     srcs = glob(["lib/Dialect/Func/*.cpp"]),
1060     includes = ["lib/Dialect/Test"],
1061     deps = [
1062         ":TestDialect",
1063         "//mlir:AffineDialect",
1064         "//mlir:FuncDialect",
1065         "//mlir:FuncTransforms",
1066         "//mlir:IR",
1067         "//mlir:Pass",
1068         "//mlir:TransformUtils",
1069         "//mlir:Transforms",
1070     ],
1073 cc_library(
1074     name = "TestTensor",
1075     srcs = glob(["lib/Dialect/Tensor/*.cpp"]),
1076     includes = ["lib/Dialect/Test"],
1077     deps = [
1078         "//mlir:ArithDialect",
1079         "//mlir:LinalgDialect",
1080         "//mlir:Pass",
1081         "//mlir:SCFDialect",
1082         "//mlir:TensorDialect",
1083         "//mlir:TensorTransforms",
1084         "//mlir:TransformDialect",
1085         "//mlir:TransformDialectInterfaces",
1086         "//mlir:TransformUtils",
1087         "//mlir:Transforms",
1088     ],
1091 cc_library(
1092     name = "TestVector",
1093     srcs = glob(["lib/Dialect/Vector/*.cpp"]),
1094     includes = ["lib/Dialect/Test"],
1095     deps = [
1096         "//mlir:AffineDialect",
1097         "//mlir:Analysis",
1098         "//mlir:ArithDialect",
1099         "//mlir:FuncDialect",
1100         "//mlir:GPUDialect",
1101         "//mlir:LLVMDialect",
1102         "//mlir:LinalgDialect",
1103         "//mlir:LinalgTransforms",
1104         "//mlir:MemRefDialect",
1105         "//mlir:NVGPUDialect",
1106         "//mlir:Pass",
1107         "//mlir:SCFDialect",
1108         "//mlir:Support",
1109         "//mlir:TensorDialect",
1110         "//mlir:TransformUtils",
1111         "//mlir:Transforms",
1112         "//mlir:VectorDialect",
1113         "//mlir:VectorToSCF",
1114         "//mlir:VectorTransforms",
1115         "//mlir:X86VectorDialect",
1116     ],
1119 cc_library(
1120     name = "TestTosaDialect",
1121     srcs = glob([
1122         "lib/Dialect/Tosa/*.cpp",
1123     ]),
1124     deps = [
1125         "//mlir:FuncDialect",
1126         "//mlir:IR",
1127         "//mlir:Pass",
1128         "//mlir:TensorDialect",
1129         "//mlir:TosaDialect",
1130         "//mlir:TransformUtils",
1131         "//mlir:Transforms",
1132     ],
1135 gentbl_cc_library(
1136     name = "TestPDLLPatternsIncGen",
1137     includes = ["lib/Dialect/Test"],
1138     strip_include_prefix = "lib",
1139     tbl_outs = [
1140         (
1141             ["-x=cpp"],
1142             "lib/Tools/PDLL/TestPDLLPatterns.h.inc",
1143         ),
1144     ],
1145     tblgen = "//mlir:mlir-pdll",
1146     td_file = "lib/Tools/PDLL/TestPDLL.pdll",
1147     deps = [
1148         ":TestDialect",
1149         ":TestOpTdFiles",
1150     ],
1153 gentbl_cc_library(
1154     name = "TestDialectConversionPDLLPatternsIncGen",
1155     includes = ["lib/Dialect/Test"],
1156     strip_include_prefix = "lib",
1157     tbl_outs = [
1158         (
1159             ["-x=cpp"],
1160             "lib/TestDialectConversionPDLLPatterns.h.inc",
1161         ),
1162     ],
1163     tblgen = "//mlir:mlir-pdll",
1164     td_file = "lib/Transforms/TestDialectConversion.pdll",
1165     deps = [
1166         ":TestDialect",
1167         ":TestOpTdFiles",
1168         "//mlir:DialectConversionPdllFiles",
1169     ],
1172 cc_library(
1173     name = "TestPDLL",
1174     srcs = ["lib/Tools/PDLL/TestPDLL.cpp"],
1175     includes = ["lib/Tools/PDLL"],
1176     deps = [
1177         ":TestDialect",
1178         ":TestPDLLPatternsIncGen",
1179         "//mlir:CastInterfaces",
1180         "//mlir:IR",
1181         "//mlir:PDLDialect",
1182         "//mlir:PDLInterpDialect",
1183         "//mlir:Parser",
1184         "//mlir:Pass",
1185         "//mlir:Support",
1186         "//mlir:TransformUtils",
1187         "//mlir:Transforms",
1188     ],