[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / utils / bazel / llvm-project-overlay / mlir / BUILD.bazel
blobdb2381168374127f8f8245570d5a06cbcdfe2cfc
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 # Description:
6 #   The MLIR "Multi-Level Intermediate Representation" Compiler Infrastructure
8 load(":tblgen.bzl", "gentbl_cc_library", "td_library")
9 load(":linalggen.bzl", "genlinalg")
10 load(":build_defs.bzl", "cc_headers_only", "if_cuda_available")
12 package(
13     default_visibility = ["//visibility:public"],
14     licenses = ["notice"],
17 exports_files([
18     "LICENSE.TXT",
19     "include/mlir/Dialect/LLVMIR/LLVMOps.td",
20     "run_lit.sh",
23 filegroup(
24     name = "c_headers",
25     srcs = glob(["include/mlir-c/**/*"]),  # <== i.e. match the entire tree
28 exports_files(glob(["include/**/*.td"]))
31     gentbl_cc_library(
32         name = name + "IncGen",
33         strip_include_prefix = "include",
34         tbl_outs = [
35             (
36                 ["-gen-op-interface-decls"],
37                 "include/mlir/IR/" + name + ".h.inc",
38             ),
39             (
40                 ["-gen-op-interface-defs"],
41                 "include/mlir/IR/" + name + ".cpp.inc",
42             ),
43         ],
44         tblgen = ":mlir-tblgen",
45         td_file = "include/mlir/IR/" + name + ".td",
46         deps = [":OpBaseTdFiles"],
47     )
48     for name in [
49         "OpAsmInterface",
50         "RegionKindInterface",
51         "SymbolInterfaces",
52     ]
55 gentbl_cc_library(
56     name = "TensorEncodingIncGen",
57     strip_include_prefix = "include",
58     tbl_outs = [
59         (
60             ["-gen-attr-interface-decls"],
61             "include/mlir/IR/TensorEncInterfaces.h.inc",
62         ),
63         (
64             ["-gen-attr-interface-defs"],
65             "include/mlir/IR/TensorEncInterfaces.cpp.inc",
66         ),
67     ],
68     tblgen = ":mlir-tblgen",
69     td_file = "include/mlir/IR/TensorEncoding.td",
70     deps = [":TensorOpsTdFiles"],
73 td_library(
74     name = "SubElementInterfacesTdFiles",
75     srcs = ["include/mlir/IR/SubElementInterfaces.td"],
76     includes = ["include"],
77     deps = [":OpBaseTdFiles"],
80 gentbl_cc_library(
81     name = "SubElementInterfacesIncGen",
82     strip_include_prefix = "include",
83     tbl_outs = [
84         (
85             ["-gen-attr-interface-decls"],
86             "include/mlir/IR/SubElementAttrInterfaces.h.inc",
87         ),
88         (
89             ["-gen-attr-interface-defs"],
90             "include/mlir/IR/SubElementAttrInterfaces.cpp.inc",
91         ),
92         (
93             ["-gen-type-interface-decls"],
94             "include/mlir/IR/SubElementTypeInterfaces.h.inc",
95         ),
96         (
97             ["-gen-type-interface-defs"],
98             "include/mlir/IR/SubElementTypeInterfaces.cpp.inc",
99         ),
100     ],
101     tblgen = ":mlir-tblgen",
102     td_file = "include/mlir/IR/SubElementInterfaces.td",
103     deps = [":SubElementInterfacesTdFiles"],
106 td_library(
107     name = "BuiltinDialectTdFiles",
108     srcs = [
109         "include/mlir/IR/BuiltinDialect.td",
110         "include/mlir/IR/BuiltinLocationAttributes.td",
111         "include/mlir/IR/BuiltinOps.td",
112         "include/mlir/IR/BuiltinTypeInterfaces.td",
113         "include/mlir/IR/BuiltinTypes.td",
114     ],
115     includes = ["include"],
116     deps = [
117         ":CallInterfacesTdFiles",
118         ":CastInterfacesTdFiles",
119         ":DataLayoutInterfacesTdFiles",
120         ":OpBaseTdFiles",
121         ":SideEffectInterfacesTdFiles",
122         ":SubElementInterfacesTdFiles",
123     ],
126 gentbl_cc_library(
127     name = "BuiltinDialectIncGen",
128     strip_include_prefix = "include",
129     tbl_outs = [
130         (
131             ["-gen-dialect-decls"],
132             "include/mlir/IR/BuiltinDialect.h.inc",
133         ),
134         (
135             ["-gen-dialect-defs"],
136             "include/mlir/IR/BuiltinDialect.cpp.inc",
137         ),
138     ],
139     tblgen = ":mlir-tblgen",
140     td_file = "include/mlir/IR/BuiltinDialect.td",
141     deps = [":BuiltinDialectTdFiles"],
144 gentbl_cc_library(
145     name = "BuiltinAttributesIncGen",
146     strip_include_prefix = "include",
147     tbl_outs = [
148         (
149             ["--gen-attrdef-decls"],
150             "include/mlir/IR/BuiltinAttributes.h.inc",
151         ),
152         (
153             ["--gen-attrdef-defs"],
154             "include/mlir/IR/BuiltinAttributes.cpp.inc",
155         ),
156     ],
157     tblgen = ":mlir-tblgen",
158     td_file = "include/mlir/IR/BuiltinAttributes.td",
159     deps = [":BuiltinDialectTdFiles"],
162 gentbl_cc_library(
163     name = "BuiltinLocationAttributesIncGen",
164     strip_include_prefix = "include",
165     tbl_outs = [
166         (
167             ["--gen-attrdef-decls"],
168             "include/mlir/IR/BuiltinLocationAttributes.h.inc",
169         ),
170         (
171             ["--gen-attrdef-defs"],
172             "include/mlir/IR/BuiltinLocationAttributes.cpp.inc",
173         ),
174     ],
175     tblgen = ":mlir-tblgen",
176     td_file = "include/mlir/IR/BuiltinLocationAttributes.td",
177     deps = [":BuiltinDialectTdFiles"],
180 gentbl_cc_library(
181     name = "BuiltinOpsIncGen",
182     strip_include_prefix = "include",
183     tbl_outs = [
184         (
185             ["-gen-op-decls"],
186             "include/mlir/IR/BuiltinOps.h.inc",
187         ),
188         (
189             ["-gen-op-defs"],
190             "include/mlir/IR/BuiltinOps.cpp.inc",
191         ),
192     ],
193     tblgen = ":mlir-tblgen",
194     td_file = "include/mlir/IR/BuiltinOps.td",
195     deps = [":BuiltinDialectTdFiles"],
198 gentbl_cc_library(
199     name = "BuiltinTypesIncGen",
200     strip_include_prefix = "include",
201     tbl_outs = [
202         (
203             ["--gen-typedef-decls"],
204             "include/mlir/IR/BuiltinTypes.h.inc",
205         ),
206         (
207             ["--gen-typedef-defs"],
208             "include/mlir/IR/BuiltinTypes.cpp.inc",
209         ),
210     ],
211     tblgen = ":mlir-tblgen",
212     td_file = "include/mlir/IR/BuiltinTypes.td",
213     deps = [":BuiltinDialectTdFiles"],
216 gentbl_cc_library(
217     name = "BuiltinTypeInterfacesIncGen",
218     strip_include_prefix = "include",
219     tbl_outs = [
220         (
221             ["--gen-type-interface-decls"],
222             "include/mlir/IR/BuiltinTypeInterfaces.h.inc",
223         ),
224         (
225             ["--gen-type-interface-defs"],
226             "include/mlir/IR/BuiltinTypeInterfaces.cpp.inc",
227         ),
228     ],
229     tblgen = ":mlir-tblgen",
230     td_file = "include/mlir/IR/BuiltinTypeInterfaces.td",
231     deps = [":BuiltinDialectTdFiles"],
234 cc_library(
235     name = "IR",
236     srcs = glob([
237         "lib/IR/*.cpp",
238         "lib/IR/*.h",
239     ]),
240     hdrs = glob([
241         "include/mlir/IR/*.h",
242     ]) + [
243         "include/mlir/Interfaces/CallInterfaces.h",
244         "include/mlir/Interfaces/CastInterfaces.h",
245         "include/mlir/Interfaces/SideEffectInterfaces.h",
246         "include/mlir/Interfaces/DataLayoutInterfaces.h",
247         "include/mlir/Interfaces/DecodeAttributesInterfaces.h",
248         "include/mlir/Interfaces/FoldInterfaces.h",
249     ],
250     includes = ["include"],
251     deps = [
252         ":BuiltinAttributesIncGen",
253         ":BuiltinDialectIncGen",
254         ":BuiltinLocationAttributesIncGen",
255         ":BuiltinOpsIncGen",
256         ":BuiltinTypeInterfacesIncGen",
257         ":BuiltinTypesIncGen",
258         ":CallOpInterfacesIncGen",
259         ":CastOpInterfacesIncGen",
260         ":DataLayoutInterfacesIncGen",
261         ":InferTypeOpInterfaceIncGen",
262         ":OpAsmInterfaceIncGen",
263         ":RegionKindInterfaceIncGen",
264         ":SideEffectInterfacesIncGen",
265         ":SubElementInterfacesIncGen",
266         ":Support",
267         ":SymbolInterfacesIncGen",
268         ":TensorEncodingIncGen",
269         "//llvm:Support",
270     ],
273 cc_library(
274     name = "Pass",
275     srcs = glob([
276         "lib/Pass/*.cpp",
277         "lib/Pass/*.h",
278     ]),
279     hdrs = glob([
280         "include/mlir/Pass/*.h",
281     ]),
282     includes = ["include"],
283     deps = [
284         ":IR",
285         ":Support",
286         "//llvm:Support",
287     ],
290 cc_library(
291     name = "CAPIIR",
292     srcs = [
293         "lib/CAPI/Dialect/Standard.cpp",
294         "lib/CAPI/IR/AffineExpr.cpp",
295         "lib/CAPI/IR/AffineMap.cpp",
296         "lib/CAPI/IR/BuiltinAttributes.cpp",
297         "lib/CAPI/IR/BuiltinTypes.cpp",
298         "lib/CAPI/IR/Diagnostics.cpp",
299         "lib/CAPI/IR/DialectHandle.cpp",
300         "lib/CAPI/IR/IR.cpp",
301         "lib/CAPI/IR/IntegerSet.cpp",
302         "lib/CAPI/IR/Pass.cpp",
303         "lib/CAPI/IR/Support.cpp",
304     ],
305     hdrs = [
306         "include/mlir-c/AffineExpr.h",
307         "include/mlir-c/AffineMap.h",
308         "include/mlir-c/BuiltinAttributes.h",
309         "include/mlir-c/BuiltinTypes.h",
310         "include/mlir-c/Diagnostics.h",
311         "include/mlir-c/Dialect/Standard.h",
312         "include/mlir-c/ExecutionEngine.h",
313         "include/mlir-c/IR.h",
314         "include/mlir-c/IntegerSet.h",
315         "include/mlir-c/Pass.h",
316         "include/mlir-c/Registration.h",
317         "include/mlir-c/Support.h",
318         "include/mlir/CAPI/AffineExpr.h",
319         "include/mlir/CAPI/AffineMap.h",
320         "include/mlir/CAPI/Diagnostics.h",
321         "include/mlir/CAPI/IR.h",
322         "include/mlir/CAPI/IntegerSet.h",
323         "include/mlir/CAPI/Pass.h",
324         "include/mlir/CAPI/Registration.h",
325         "include/mlir/CAPI/Support.h",
326         "include/mlir/CAPI/Utils.h",
327         "include/mlir/CAPI/Wrap.h",
328     ],
329     includes = ["include"],
330     deps = [
331         ":ConversionPassIncGen",
332         ":IR",
333         ":InferTypeOpInterface",
334         ":Parser",
335         ":Pass",
336         ":StandardOps",
337         ":Support",
338         "//llvm:Support",
339     ],
342 cc_library(
343     name = "CAPIAsync",
344     srcs = [
345         "lib/CAPI/Dialect/Async.cpp",
346         "lib/CAPI/Dialect/AsyncPasses.cpp",
347     ],
348     hdrs = [
349         "include/mlir-c/Dialect/Async.h",
350     ],
351     includes = ["include"],
352     deps = [
353         ":Async",
354         ":AsyncPassIncGen",
355         ":AsyncTransforms",
356         ":CAPIIR",
357         ":Pass",
358     ],
361 cc_library(
362     name = "CAPILinalg",
363     srcs = [
364         "lib/CAPI/Dialect/Linalg.cpp",
365         "lib/CAPI/Dialect/LinalgPasses.cpp",
366     ],
367     hdrs = [
368         "include/mlir-c/Dialect/Linalg.h",
369     ],
370     includes = ["include"],
371     deps = [
372         ":CAPIIR",
373         ":LinalgOps",
374         ":LinalgPassIncGen",
375         ":LinalgTransforms",
376         ":Pass",
377     ],
380 cc_library(
381     name = "CAPILLVM",
382     srcs = [
383         "lib/CAPI/Dialect/LLVM.cpp",
384     ],
385     hdrs = [
386         "include/mlir-c/Dialect/LLVM.h",
387     ],
388     includes = ["include"],
389     deps = [
390         ":CAPIIR",
391         ":LLVMDialect",
392     ],
395 cc_library(
396     name = "CAPIGPU",
397     srcs = [
398         "lib/CAPI/Dialect/GPU.cpp",
399         "lib/CAPI/Dialect/GPUPasses.cpp",
400     ],
401     hdrs = [
402         "include/mlir-c/Dialect/GPU.h",
403     ],
404     includes = ["include"],
405     deps = [
406         ":CAPIIR",
407         ":GPUDialect",
408         ":GPUPassIncGen",
409         ":GPUTransforms",
410         ":Pass",
411     ],
414 cc_library(
415     name = "CAPISparseTensor",
416     srcs = [
417         "lib/CAPI/Dialect/SparseTensor.cpp",
418         "lib/CAPI/Dialect/SparseTensorPasses.cpp",
419     ],
420     hdrs = [
421         "include/mlir-c/Dialect/SparseTensor.h",
422     ],
423     includes = ["include"],
424     deps = [
425         ":CAPIIR",
426         ":Pass",
427         ":SparseTensor",
428         ":SparseTensorPassIncGen",
429         ":SparseTensorTransforms",
430         ":Support",
431     ],
434 cc_library(
435     name = "CAPIConversion",
436     srcs = ["lib/CAPI/Conversion/Passes.cpp"],
437     hdrs = ["include/mlir-c/Conversion.h"],
438     includes = ["include"],
439     deps = [
440         ":CAPIIR",
441         ":ConversionPassIncGen",
442         ":ConversionPasses",
443         ":Pass",
444     ],
447 cc_library(
448     name = "CAPIDebug",
449     srcs = ["lib/CAPI/Debug/Debug.cpp"],
450     hdrs = ["include/mlir-c/Debug.h"],
451     includes = ["include"],
452     deps = [
453         ":CAPIIR",
454         ":Support",
455         "//llvm:Support",
456     ],
459 cc_library(
460     name = "CAPIExecutionEngine",
461     srcs = ["lib/CAPI/ExecutionEngine/ExecutionEngine.cpp"],
462     hdrs = [
463         "include/mlir-c/ExecutionEngine.h",
464         "include/mlir/CAPI/ExecutionEngine.h",
465     ],
466     includes = ["include"],
467     deps = [
468         ":CAPIIR",
469         ":ExecutionEngine",
470         ":ExecutionEngineUtils",
471         ":LLVMToLLVMIRTranslation",
472         "//llvm:OrcJIT",
473         "//llvm:Support",
474     ],
477 cc_library(
478     name = "CAPITransforms",
479     srcs = ["lib/CAPI/Transforms/Passes.cpp"],
480     hdrs = ["include/mlir-c/Transforms.h"],
481     includes = ["include"],
482     deps = [
483         ":CAPIIR",
484         ":Pass",
485         ":Transforms",
486         ":TransformsPassIncGen",
487     ],
490 cc_library(
491     name = "CAPIRegistration",
492     srcs = ["lib/CAPI/Registration/Registration.cpp"],
493     hdrs = ["include/mlir-c/Registration.h"],
494     includes = ["include"],
495     deps = [
496         ":AllPassesAndDialects",
497         ":CAPIIR",
498         ":LLVMToLLVMIRTranslation",
499     ],
502 ##---------------------------------------------------------------------------##
503 # Sources of Python bindings.
504 #----------------------------------------------------------------------------##
506 exports_files(
507     glob(["lib/Bindings/Python/**/*.cpp"]),
510 cc_library(
511     name = "MLIRBindingsPythonHeadersAndDeps",
512     includes = [
513         "include",
514         "lib/Bindings/Python",
515     ],
516     tags = [
517         "manual",  # External dependency
518         "nobuildkite",  # TODO(gcmn): Add support for this target
519     ],
520     textual_hdrs = glob([
521         "lib/Bindings/Python/*.h",
522         "include/mlir-c/Bindings/Python/*.h",
523         "include/mlir/Bindings/Python/*.h",
524     ]),
525     deps = [
526         ":CAPIIR",
527         "@pybind11",
528         "@python_runtime//:headers",
529     ],
532 cc_library(
533     name = "MLIRBindingsPythonCore",
534     srcs = [
535         "lib/Bindings/Python/DialectLinalg.cpp",
536         "lib/Bindings/Python/DialectSparseTensor.cpp",
537         "lib/Bindings/Python/IRAffine.cpp",
538         "lib/Bindings/Python/IRAttributes.cpp",
539         "lib/Bindings/Python/IRCore.cpp",
540         "lib/Bindings/Python/IRModule.cpp",
541         "lib/Bindings/Python/IRTypes.cpp",
542         "lib/Bindings/Python/Pass.cpp",
543         "lib/Bindings/Python/PybindUtils.cpp",
544     ],
545     # These flags are needed for pybind11 to work.
546     copts = [
547         "-fexceptions",
548         "-frtti",
549     ],
550     features = [
551         # Cannot use header_modules (parse_headers feature fails).
552         "-use_header_modules",
553     ],
554     tags = [
555         "manual",  # External dependency
556         "nobuildkite",  # TODO(gcmn): Add support for this target
557     ],
558     deps = [
559         ":CAPIAsync",
560         ":CAPIDebug",
561         ":CAPIGPU",
562         ":CAPIIR",
563         ":CAPILinalg",
564         ":CAPIRegistration",
565         ":CAPISparseTensor",
566         ":MLIRBindingsPythonHeadersAndDeps",
567         "//llvm:Support",
568         "@pybind11",
569         "@python_runtime//:headers",
570     ],
573 PYBIND11_COPTS = [
574     "-fexceptions",
575     "-frtti",
578 PYBIND11_FEATURES = [
579     # Cannot use header_modules (parse_headers feature fails).
580     "-use_header_modules",
583 # Dynamic library with the MLIR Python extension.
584 cc_binary(
585     name = "_mlir.so",
586     srcs = ["lib/Bindings/Python/MainModule.cpp"],
587     # These flags are needed for pybind11 to work.
588     copts = PYBIND11_COPTS,
589     features = PYBIND11_FEATURES,
590     linkshared = 1,
591     linkstatic = 0,
592     tags = [
593         "manual",  # External dependency
594         "nobuildkite",  # TODO(gcmn): Add support for this target
595     ],
596     deps = [
597         ":MLIRBindingsPythonCore",
598         ":MLIRBindingsPythonHeadersAndDeps",
599     ],
602 # Dynamic library with the MLIR Conversions Python extension.
603 cc_binary(
604     name = "_mlirConversions.so",
605     srcs = ["lib/Bindings/Python/Conversions/Conversions.cpp"],
606     copts = PYBIND11_COPTS,
607     features = PYBIND11_FEATURES,
608     linkshared = 1,
609     linkstatic = 0,
610     tags = [
611         "manual",  # External dependency
612         "nobuildkite",  # TODO(gcmn): Add support for this target
613     ],
614     deps = [
615         ":CAPIConversion",
616         ":MLIRBindingsPythonHeadersAndDeps",
617         "@pybind11",
618         "@python_runtime//:headers",
619     ],
622 # Dynamic library with the MLIR Conversions Python extension.
623 cc_binary(
624     name = "_mlirExecutionEngine.so",
625     srcs = ["lib/Bindings/Python/ExecutionEngineModule.cpp"],
626     copts = PYBIND11_COPTS,
627     features = PYBIND11_FEATURES,
628     linkshared = 1,
629     linkstatic = 0,
630     tags = [
631         "manual",  # External dependency
632         "nobuildkite",  # TODO(gcmn): Add support for this target
633     ],
634     deps = [
635         ":CAPIExecutionEngine",
636         ":MLIRBindingsPythonHeadersAndDeps",
637         "@pybind11",
638         "@python_runtime//:headers",
639     ],
642 # Dynamic library with the MLIR Transforms Python extension.
643 cc_binary(
644     name = "_mlirTransforms.so",
645     srcs = ["lib/Bindings/Python/Transforms/Transforms.cpp"],
646     copts = PYBIND11_COPTS,
647     features = PYBIND11_FEATURES,
648     linkshared = 1,
649     linkstatic = 0,
650     tags = [
651         "manual",  # External dependency
652         "nobuildkite",  # TODO(gcmn): Add support for this target
653     ],
654     deps = [
655         ":CAPITransforms",
656         ":MLIRBindingsPythonHeadersAndDeps",
657         "@pybind11",
658         "@python_runtime//:headers",
659     ],
662 # Dynamic library with the MLIR Linalg dialect+passes Python extension.
663 cc_binary(
664     name = "_mlirLinalgPasses.so",
665     srcs = ["lib/Bindings/Python/LinalgPasses.cpp"],
666     copts = PYBIND11_COPTS,
667     features = PYBIND11_FEATURES,
668     linkshared = 1,
669     linkstatic = 0,
670     tags = [
671         "manual",  # External dependency
672         "nobuildkite",  # TODO(gcmn): Add support for this target
673     ],
674     deps = [
675         ":CAPILinalg",
676         ":MLIRBindingsPythonHeadersAndDeps",
677         "@pybind11",
678         "@python_runtime//:headers",
679     ],
682 ##---------------------------------------------------------------------------##
684 td_library(
685     name = "OpBaseTdFiles",
686     srcs = [
687         "include/mlir/IR/OpAsmInterface.td",
688         "include/mlir/IR/OpBase.td",
689         "include/mlir/IR/RegionKindInterface.td",
690         "include/mlir/IR/SymbolInterfaces.td",
691         "include/mlir/IR/TensorEncoding.td",
692     ],
693     includes = ["include"],
696 td_library(
697     name = "CallInterfacesTdFiles",
698     srcs = ["include/mlir/Interfaces/CallInterfaces.td"],
699     includes = ["include"],
700     deps = [":OpBaseTdFiles"],
703 td_library(
704     name = "CastInterfacesTdFiles",
705     srcs = ["include/mlir/Interfaces/CastInterfaces.td"],
706     includes = ["include"],
707     deps = [":OpBaseTdFiles"],
710 td_library(
711     name = "ControlFlowInterfacesTdFiles",
712     srcs = ["include/mlir/Interfaces/ControlFlowInterfaces.td"],
713     includes = ["include"],
714     deps = [":OpBaseTdFiles"],
717 td_library(
718     name = "CopyOpInterfaceTdFiles",
719     srcs = ["include/mlir/Interfaces/CopyOpInterface.td"],
720     includes = ["include"],
721     deps = [":OpBaseTdFiles"],
724 td_library(
725     name = "DerivedAttributeOpInterfaceTdFiles",
726     srcs = ["include/mlir/Interfaces/DerivedAttributeOpInterface.td"],
727     includes = ["include"],
728     deps = [":OpBaseTdFiles"],
731 td_library(
732     name = "InferTypeOpInterfaceTdFiles",
733     srcs = ["include/mlir/Interfaces/InferTypeOpInterface.td"],
734     includes = ["include"],
735     deps = [":OpBaseTdFiles"],
738 td_library(
739     name = "LoopLikeInterfaceTdFiles",
740     srcs = ["include/mlir/Interfaces/LoopLikeInterface.td"],
741     includes = ["include"],
742     deps = [":OpBaseTdFiles"],
745 td_library(
746     name = "SideEffectInterfacesTdFiles",
747     srcs = [
748         "include/mlir/Interfaces/SideEffectInterfaceBase.td",
749         "include/mlir/Interfaces/SideEffectInterfaces.td",
750     ],
751     includes = ["include"],
752     deps = [":OpBaseTdFiles"],
755 alias(
756     name = "SideEffectTdFiles",
757     actual = ":SideEffectInterfacesTdFiles",
760 td_library(
761     name = "VectorInterfacesTdFiles",
762     srcs = ["include/mlir/Interfaces/VectorInterfaces.td"],
763     includes = ["include"],
764     deps = [":OpBaseTdFiles"],
767 td_library(
768     name = "ViewLikeInterfaceTdFiles",
769     srcs = ["include/mlir/Interfaces/ViewLikeInterface.td"],
770     includes = ["include"],
771     deps = [":OpBaseTdFiles"],
774 td_library(
775     name = "ReducerTdFiles",
776     srcs = ["include/mlir/Reducer/Passes.td"],
777     includes = ["include"],
778     deps = [":OpBaseTdFiles"],
781 ##---------------------------------------------------------------------------##
782 # Affine dialect.
783 ##---------------------------------------------------------------------------##
785 td_library(
786     name = "PassBaseTdFiles",
787     srcs = ["include/mlir/Pass/PassBase.td"],
788     includes = ["include"],
791 td_library(
792     name = "RewritePassBaseTdFiles",
793     srcs = ["include/mlir/Rewrite/PassUtil.td"],
794     includes = ["include"],
797 td_library(
798     name = "AffineOpsTdFiles",
799     srcs = [
800         "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td",
801         "include/mlir/Dialect/Affine/IR/AffineOps.td",
802     ],
803     includes = ["include"],
804     deps = [
805         ":LoopLikeInterfaceTdFiles",
806         ":OpBaseTdFiles",
807         ":SideEffectInterfacesTdFiles",
808         ":StdOpsTdFiles",
809     ],
812 gentbl_cc_library(
813     name = "AffineOpsIncGen",
814     strip_include_prefix = "include",
815     tbl_outs = [
816         (
817             ["-gen-op-decls"],
818             "include/mlir/Dialect/Affine/IR/AffineOps.h.inc",
819         ),
820         (
821             ["-gen-op-defs"],
822             "include/mlir/Dialect/Affine/IR/AffineOps.cpp.inc",
823         ),
824         (
825             ["-gen-dialect-decls"],
826             "include/mlir/Dialect/Affine/IR/AffineOpsDialect.h.inc",
827         ),
828         (
829             ["-gen-dialect-defs"],
830             "include/mlir/Dialect/Affine/IR/AffineOpsDialect.cpp.inc",
831         ),
832     ],
833     tblgen = ":mlir-tblgen",
834     td_file = "include/mlir/Dialect/Affine/IR/AffineOps.td",
835     deps = [":AffineOpsTdFiles"],
838 gentbl_cc_library(
839     name = "AffineMemoryOpInterfacesIncGen",
840     strip_include_prefix = "include",
841     tbl_outs = [
842         (
843             ["-gen-op-interface-decls"],
844             "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.h.inc",
845         ),
846         (
847             ["-gen-op-interface-defs"],
848             "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.cpp.inc",
849         ),
850     ],
851     tblgen = ":mlir-tblgen",
852     td_file = "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td",
853     deps = [":AffineOpsTdFiles"],
856 ##---------------------------------------------------------------------------##
857 # EmitC dialect.
858 ##---------------------------------------------------------------------------##
860 td_library(
861     name = "EmitCTdFiles",
862     srcs = [
863         "include/mlir/Dialect/EmitC/IR/EmitC.td",
864         "include/mlir/Dialect/EmitC/IR/EmitCAttributes.td",
865         "include/mlir/Dialect/EmitC/IR/EmitCBase.td",
866         "include/mlir/Dialect/EmitC/IR/EmitCTypes.td",
867     ],
868     includes = ["include"],
869     deps = [
870         ":OpBaseTdFiles",
871         ":SideEffectInterfacesTdFiles",
872     ],
875 gentbl_cc_library(
876     name = "EmitCAttributesIncGen",
877     strip_include_prefix = "include",
878     tbl_outs = [
879         (
880             ["--gen-attrdef-decls"],
881             "include/mlir/Dialect/EmitC/IR/EmitCAttributes.h.inc",
882         ),
883         (
884             ["--gen-attrdef-defs"],
885             "include/mlir/Dialect/EmitC/IR/EmitCAttributes.cpp.inc",
886         ),
887     ],
888     tblgen = ":mlir-tblgen",
889     td_file = "include/mlir/Dialect/EmitC/IR/EmitCAttributes.td",
890     deps = [":EmitCTdFiles"],
893 gentbl_cc_library(
894     name = "EmitCOpsIncGen",
895     strip_include_prefix = "include",
896     tbl_outs = [
897         (
898             ["-gen-dialect-decls"],
899             "include/mlir/Dialect/EmitC/IR/EmitCDialect.h.inc",
900         ),
901         (
902             ["-gen-dialect-defs"],
903             "include/mlir/Dialect/EmitC/IR/EmitCDialect.cpp.inc",
904         ),
905         (
906             ["-gen-op-decls"],
907             "include/mlir/Dialect/EmitC/IR/EmitC.h.inc",
908         ),
909         (
910             ["-gen-op-defs"],
911             "include/mlir/Dialect/EmitC/IR/EmitC.cpp.inc",
912         ),
913         (
914             ["-gen-typedef-decls"],
915             "include/mlir/Dialect/EmitC/IR/EmitCTypes.h.inc",
916         ),
917         (
918             ["-gen-typedef-defs"],
919             "include/mlir/Dialect/EmitC/IR/EmitCTypes.cpp.inc",
920         ),
921     ],
922     tblgen = ":mlir-tblgen",
923     td_file = "include/mlir/Dialect/EmitC/IR/EmitC.td",
924     deps = [":EmitCTdFiles"],
927 ##---------------------------------------------------------------------------##
928 # Async dialect.
929 ##---------------------------------------------------------------------------##
931 td_library(
932     name = "AsyncOpsTdFiles",
933     srcs = [
934         "include/mlir/Dialect/Async/IR/AsyncDialect.td",
935         "include/mlir/Dialect/Async/IR/AsyncOps.td",
936         "include/mlir/Dialect/Async/IR/AsyncTypes.td",
937     ],
938     includes = ["include"],
939     deps = [
940         ":ControlFlowInterfacesTdFiles",
941         ":OpBaseTdFiles",
942         ":SideEffectInterfacesTdFiles",
943     ],
946 gentbl_cc_library(
947     name = "AsyncOpsIncGen",
948     strip_include_prefix = "include",
949     tbl_outs = [
950         (
951             ["-gen-op-decls"],
952             "include/mlir/Dialect/Async/IR/AsyncOps.h.inc",
953         ),
954         (
955             ["-gen-op-defs"],
956             "include/mlir/Dialect/Async/IR/AsyncOps.cpp.inc",
957         ),
958         (
959             ["-gen-dialect-decls"],
960             "include/mlir/Dialect/Async/IR/AsyncOpsDialect.h.inc",
961         ),
962         (
963             ["-gen-dialect-defs"],
964             "include/mlir/Dialect/Async/IR/AsyncOpsDialect.cpp.inc",
965         ),
966         (
967             ["-gen-typedef-decls"],
968             "include/mlir/Dialect/Async/IR/AsyncOpsTypes.h.inc",
969         ),
970         (
971             ["-gen-typedef-defs"],
972             "include/mlir/Dialect/Async/IR/AsyncOpsTypes.cpp.inc",
973         ),
974     ],
975     tblgen = ":mlir-tblgen",
976     td_file = "include/mlir/Dialect/Async/IR/AsyncOps.td",
977     deps = [":AsyncOpsTdFiles"],
980 gentbl_cc_library(
981     name = "AsyncPassIncGen",
982     strip_include_prefix = "include",
983     tbl_outs = [
984         (
985             [
986                 "-gen-pass-decls",
987                 "-name=Async",
988             ],
989             "include/mlir/Dialect/Async/Passes.h.inc",
990         ),
991         (
992             [
993                 "-gen-pass-capi-header",
994                 "--prefix=Async",
995             ],
996             "include/mlir/Dialect/Async/Passes.capi.h.inc",
997         ),
998         (
999             [
1000                 "-gen-pass-capi-impl",
1001                 "--prefix=Async",
1002             ],
1003             "include/mlir/Dialect/Async/Passes.capi.cpp.inc",
1004         ),
1005     ],
1006     tblgen = ":mlir-tblgen",
1007     td_file = "include/mlir/Dialect/Async/Passes.td",
1008     deps = [":PassBaseTdFiles"],
1011 ##---------------------------------------------------------------------------##
1012 # ArmNeon dialect.
1013 ##---------------------------------------------------------------------------##
1015 td_library(
1016     name = "ArmNeonTdFiles",
1017     srcs = ["include/mlir/Dialect/ArmNeon/ArmNeon.td"],
1018     includes = ["include"],
1019     deps = [
1020         ":LLVMOpsTdFiles",
1021         ":OpBaseTdFiles",
1022         ":SideEffectInterfacesTdFiles",
1023     ],
1026 gentbl_cc_library(
1027     name = "ArmNeonIncGen",
1028     strip_include_prefix = "include",
1029     tbl_outs = [
1030         (
1031             [
1032                 "-gen-dialect-decls",
1033                 "-dialect=arm_neon",
1034             ],
1035             "include/mlir/Dialect/ArmNeon/ArmNeonDialect.h.inc",
1036         ),
1037         (
1038             [
1039                 "-gen-dialect-defs",
1040                 "-dialect=arm_neon",
1041             ],
1042             "include/mlir/Dialect/ArmNeon/ArmNeonDialect.cpp.inc",
1043         ),
1044         (
1045             ["-gen-op-decls"],
1046             "include/mlir/Dialect/ArmNeon/ArmNeon.h.inc",
1047         ),
1048         (
1049             ["-gen-op-defs"],
1050             "include/mlir/Dialect/ArmNeon/ArmNeon.cpp.inc",
1051         ),
1052         (
1053             ["-gen-op-doc"],
1054             "g3doc/Dialects/ArmNeon/ArmNeon.md",
1055         ),
1056     ],
1057     tblgen = ":mlir-tblgen",
1058     td_file = "include/mlir/Dialect/ArmNeon/ArmNeon.td",
1059     deps = [":ArmNeonTdFiles"],
1062 cc_library(
1063     name = "ArmNeon",
1064     srcs = ["lib/Dialect/ArmNeon/IR/ArmNeonDialect.cpp"],
1065     hdrs = ["include/mlir/Dialect/ArmNeon/ArmNeonDialect.h"],
1066     includes = ["include"],
1067     deps = [
1068         ":ArmNeonIncGen",
1069         ":IR",
1070         ":SideEffectInterfaces",
1071         ":VectorOps",
1072         "//llvm:Core",
1073         "//llvm:Support",
1074     ],
1077 gentbl_cc_library(
1078     name = "ArmNeonConversionIncGen",
1079     strip_include_prefix = "include",
1080     tbl_outs = [
1081         (
1082             ["-gen-llvmir-conversions"],
1083             "include/mlir/Dialect/ArmNeon/ArmNeonConversions.inc",
1084         ),
1085     ],
1086     tblgen = ":mlir-tblgen",
1087     td_file = "include/mlir/Dialect/ArmNeon/ArmNeon.td",
1088     deps = [":ArmNeonTdFiles"],
1091 cc_library(
1092     name = "ArmNeon2dToIntr",
1093     srcs = glob([
1094         "lib/Conversion/ArmNeon2dToIntr/*.cpp",
1095         "lib/Conversion/ArmNeon2dToIntr/*.h",
1096     ]) + ["lib/Conversion/PassDetail.h"],
1097     hdrs = glob([
1098         "include/mlir/Conversion/ArmNeon2dToIntr/*.h",
1099     ]),
1100     includes = ["include"],
1101     deps = [
1102         ":ArmNeon",
1103         ":ConversionPassIncGen",
1104         ":IR",
1105         ":MemRefDialect",
1106         ":OpenACCDialect",
1107         ":Pass",
1108         ":SCFDialect",
1109         ":StandardOps",
1110         ":Support",
1111         ":Transforms",
1112         ":VectorOps",
1113     ],
1116 ##---------------------------------------------------------------------------##
1117 # ArmSVE dialect.
1118 ##---------------------------------------------------------------------------##
1120 td_library(
1121     name = "ArmSVETdFiles",
1122     srcs = [
1123         "include/mlir/Dialect/ArmSVE/ArmSVE.td",
1124         "include/mlir/Dialect/ArmSVE/ArmSVEOpBase.td",
1125     ],
1126     includes = ["include"],
1127     deps = [
1128         ":LLVMOpsTdFiles",
1129         ":OpBaseTdFiles",
1130         ":SideEffectInterfacesTdFiles",
1131         ":StdOpsTdFiles",
1132     ],
1135 gentbl_cc_library(
1136     name = "ArmSVEIncGen",
1137     strip_include_prefix = "include",
1138     tbl_outs = [
1139         (
1140             ["-gen-op-decls"],
1141             "include/mlir/Dialect/ArmSVE/ArmSVE.h.inc",
1142         ),
1143         (
1144             ["-gen-op-defs"],
1145             "include/mlir/Dialect/ArmSVE/ArmSVE.cpp.inc",
1146         ),
1147         (
1148             ["-gen-typedef-decls"],
1149             "include/mlir/Dialect/ArmSVE/ArmSVETypes.h.inc",
1150         ),
1151         (
1152             ["-gen-typedef-defs"],
1153             "include/mlir/Dialect/ArmSVE/ArmSVETypes.cpp.inc",
1154         ),
1155         (
1156             [
1157                 "-gen-dialect-decls",
1158                 "-dialect=arm_sve",
1159             ],
1160             "include/mlir/Dialect/ArmSVE/ArmSVEDialect.h.inc",
1161         ),
1162         (
1163             [
1164                 "-gen-dialect-defs",
1165                 "-dialect=arm_sve",
1166             ],
1167             "include/mlir/Dialect/ArmSVE/ArmSVEDialect.cpp.inc",
1168         ),
1169     ],
1170     tblgen = ":mlir-tblgen",
1171     td_file = "include/mlir/Dialect/ArmSVE/ArmSVE.td",
1172     deps = [":ArmSVETdFiles"],
1175 cc_library(
1176     name = "ArmSVE",
1177     srcs = ["lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp"],
1178     hdrs = ["include/mlir/Dialect/ArmSVE/ArmSVEDialect.h"],
1179     includes = ["include"],
1180     deps = [
1181         ":ArmSVEIncGen",
1182         ":IR",
1183         ":LLVMDialect",
1184         ":SideEffectInterfaces",
1185         ":StandardOps",
1186         ":VectorOps",
1187         "//llvm:Core",
1188         "//llvm:Support",
1189     ],
1192 cc_library(
1193     name = "ArmSVETransforms",
1194     srcs = glob(["lib/Dialect/ArmSVE/Transforms/*.cpp"]),
1195     hdrs = ["include/mlir/Dialect/ArmSVE/Transforms.h"],
1196     includes = ["include"],
1197     deps = [
1198         ":ArmSVE",
1199         ":IR",
1200         ":LLVMCommonConversion",
1201         ":LLVMDialect",
1202         ":Pass",
1203         ":StandardOps",
1204         ":TransformUtils",
1205         "//llvm:Core",
1206         "//llvm:Support",
1207     ],
1210 gentbl_cc_library(
1211     name = "ArmSVEConversionIncGen",
1212     strip_include_prefix = "include",
1213     tbl_outs = [
1214         (
1215             ["-gen-llvmir-conversions"],
1216             "include/mlir/Dialect/ArmSVE/ArmSVEConversions.inc",
1217         ),
1218     ],
1219     tblgen = ":mlir-tblgen",
1220     td_file = "include/mlir/Dialect/ArmSVE/ArmSVE.td",
1221     deps = [":ArmSVETdFiles"],
1224 ##---------------------------------------------------------------------------##
1225 # AMX dialect.
1226 ##---------------------------------------------------------------------------##
1228 td_library(
1229     name = "AMXTdFiles",
1230     srcs = ["include/mlir/Dialect/AMX/AMX.td"],
1231     includes = ["include"],
1232     deps = [
1233         ":LLVMOpsTdFiles",
1234         ":SideEffectInterfacesTdFiles",
1235     ],
1238 gentbl_cc_library(
1239     name = "AMXIncGen",
1240     strip_include_prefix = "include",
1241     tbl_outs = [
1242         (
1243             [
1244                 "-gen-dialect-decls",
1245                 "-dialect=amx",
1246             ],
1247             "include/mlir/Dialect/AMX/AMXDialect.h.inc",
1248         ),
1249         (
1250             [
1251                 "-gen-dialect-defs",
1252                 "-dialect=amx",
1253             ],
1254             "include/mlir/Dialect/AMX/AMXDialect.cpp.inc",
1255         ),
1256         (
1257             ["-gen-op-decls"],
1258             "include/mlir/Dialect/AMX/AMX.h.inc",
1259         ),
1260         (
1261             ["-gen-op-defs"],
1262             "include/mlir/Dialect/AMX/AMX.cpp.inc",
1263         ),
1264         (
1265             ["-gen-op-doc"],
1266             "g3doc/Dialects/AMX/AMX.md",
1267         ),
1268     ],
1269     tblgen = ":mlir-tblgen",
1270     td_file = "include/mlir/Dialect/AMX/AMX.td",
1271     deps = [":AMXTdFiles"],
1274 cc_library(
1275     name = "AMX",
1276     srcs = ["lib/Dialect/AMX/IR/AMXDialect.cpp"],
1277     hdrs = ["include/mlir/Dialect/AMX/AMXDialect.h"],
1278     includes = ["include"],
1279     deps = [
1280         ":AMXIncGen",
1281         ":IR",
1282         ":LLVMDialect",
1283         ":SideEffectInterfaces",
1284         "//llvm:Core",
1285         "//llvm:Support",
1286     ],
1289 cc_library(
1290     name = "AMXTransforms",
1291     srcs = glob(["lib/Dialect/AMX/Transforms/*.cpp"]),
1292     hdrs = ["include/mlir/Dialect/AMX/Transforms.h"],
1293     includes = ["include"],
1294     deps = [
1295         ":AMX",
1296         ":IR",
1297         ":LLVMCommonConversion",
1298         ":LLVMDialect",
1299         ":StandardOps",
1300         "//llvm:Core",
1301         "//llvm:Support",
1302     ],
1305 gentbl_cc_library(
1306     name = "AMXConversionIncGen",
1307     strip_include_prefix = "include",
1308     tbl_outs = [
1309         (
1310             ["-gen-llvmir-conversions"],
1311             "include/mlir/Dialect/AMX/AMXConversions.inc",
1312         ),
1313     ],
1314     tblgen = ":mlir-tblgen",
1315     td_file = "include/mlir/Dialect/AMX/AMX.td",
1316     deps = [":AMXTdFiles"],
1319 ##---------------------------------------------------------------------------##
1320 # X86Vector dialect.
1321 ##---------------------------------------------------------------------------##
1323 td_library(
1324     name = "X86VectorTdFiles",
1325     srcs = ["include/mlir/Dialect/X86Vector/X86Vector.td"],
1326     includes = ["include"],
1327     deps = [
1328         ":LLVMOpsTdFiles",
1329         ":SideEffectInterfacesTdFiles",
1330     ],
1333 gentbl_cc_library(
1334     name = "X86VectorIncGen",
1335     strip_include_prefix = "include",
1336     tbl_outs = [
1337         (
1338             [
1339                 "-gen-dialect-decls",
1340                 "-dialect=x86vector",
1341             ],
1342             "include/mlir/Dialect/X86Vector/X86VectorDialect.h.inc",
1343         ),
1344         (
1345             [
1346                 "-gen-dialect-defs",
1347                 "-dialect=x86vector",
1348             ],
1349             "include/mlir/Dialect/X86Vector/X86VectorDialect.cpp.inc",
1350         ),
1351         (
1352             ["-gen-op-decls"],
1353             "include/mlir/Dialect/X86Vector/X86Vector.h.inc",
1354         ),
1355         (
1356             ["-gen-op-defs"],
1357             "include/mlir/Dialect/X86Vector/X86Vector.cpp.inc",
1358         ),
1359         (
1360             ["-gen-op-doc"],
1361             "g3doc/Dialects/X86Vector/X86Vector.md",
1362         ),
1363     ],
1364     tblgen = ":mlir-tblgen",
1365     td_file = "include/mlir/Dialect/X86Vector/X86Vector.td",
1366     deps = [":X86VectorTdFiles"],
1369 cc_library(
1370     name = "X86Vector",
1371     srcs = ["lib/Dialect/X86Vector/IR/X86VectorDialect.cpp"],
1372     hdrs = ["include/mlir/Dialect/X86Vector/X86VectorDialect.h"],
1373     includes = ["include"],
1374     deps = [
1375         ":IR",
1376         ":LLVMDialect",
1377         ":SideEffectInterfaces",
1378         ":X86VectorIncGen",
1379         "//llvm:Core",
1380         "//llvm:Support",
1381     ],
1384 cc_library(
1385     name = "X86VectorTransforms",
1386     srcs = glob(["lib/Dialect/X86Vector/Transforms/*.cpp"]),
1387     hdrs = ["include/mlir/Dialect/X86Vector/Transforms.h"],
1388     includes = ["include"],
1389     deps = [
1390         ":IR",
1391         ":LLVMCommonConversion",
1392         ":LLVMDialect",
1393         ":StandardOps",
1394         ":X86Vector",
1395         "//llvm:Core",
1396         "//llvm:Support",
1397     ],
1400 gentbl_cc_library(
1401     name = "X86VectorConversionIncGen",
1402     strip_include_prefix = "include",
1403     tbl_outs = [
1404         (
1405             ["-gen-llvmir-conversions"],
1406             "include/mlir/Dialect/X86Vector/X86VectorConversions.inc",
1407         ),
1408     ],
1409     tblgen = ":mlir-tblgen",
1410     td_file = "include/mlir/Dialect/X86Vector/X86Vector.td",
1411     deps = [":X86VectorTdFiles"],
1414 ##---------------------------------------------------------------------------##
1415 # SCF dialect.
1416 ##---------------------------------------------------------------------------##
1418 td_library(
1419     name = "SCFTdFiles",
1420     srcs = ["include/mlir/Dialect/SCF/SCFOps.td"],
1421     includes = ["include"],
1422     deps = [
1423         ":ControlFlowInterfacesTdFiles",
1424         ":LoopLikeInterfaceTdFiles",
1425         ":SideEffectInterfacesTdFiles",
1426     ],
1429 gentbl_cc_library(
1430     name = "SCFIncGen",
1431     strip_include_prefix = "include",
1432     tbl_outs = [
1433         (
1434             ["-gen-op-decls"],
1435             "include/mlir/Dialect/SCF/SCFOps.h.inc",
1436         ),
1437         (
1438             ["-gen-op-defs"],
1439             "include/mlir/Dialect/SCF/SCFOps.cpp.inc",
1440         ),
1441         (
1442             ["-gen-dialect-decls"],
1443             "include/mlir/Dialect/SCF/SCFOpsDialect.h.inc",
1444         ),
1445         (
1446             ["-gen-dialect-defs"],
1447             "include/mlir/Dialect/SCF/SCFOpsDialect.cpp.inc",
1448         ),
1449     ],
1450     tblgen = ":mlir-tblgen",
1451     td_file = "include/mlir/Dialect/SCF/SCFOps.td",
1452     deps = [":SCFTdFiles"],
1455 gentbl_cc_library(
1456     name = "SCFPassIncGen",
1457     strip_include_prefix = "include",
1458     tbl_outs = [
1459         (
1460             [
1461                 "-gen-pass-decls",
1462                 "-name=SCF",
1463             ],
1464             "include/mlir/Dialect/SCF/Passes.h.inc",
1465         ),
1466     ],
1467     tblgen = ":mlir-tblgen",
1468     td_file = "include/mlir/Dialect/SCF/Passes.td",
1469     deps = [":PassBaseTdFiles"],
1472 cc_library(
1473     name = "SCFTransforms",
1474     srcs = glob([
1475         "lib/Dialect/SCF/Transforms/*.cpp",
1476         "lib/Dialect/SCF/Transforms/*.h",
1477     ]),
1478     hdrs = ["include/mlir/Dialect/SCF/Passes.h"],
1479     includes = ["include"],
1480     deps = [
1481         ":Affine",
1482         ":Analysis",
1483         ":DialectUtils",
1484         ":IR",
1485         ":MemRefDialect",
1486         ":Pass",
1487         ":SCFDialect",
1488         ":SCFPassIncGen",
1489         ":StandardOps",
1490         ":Support",
1491         ":Transforms",
1492         "//llvm:Support",
1493     ],
1496 ##---------------------------------------------------------------------------##
1497 # SparseTensor dialect.
1498 ##---------------------------------------------------------------------------##
1500 td_library(
1501     name = "SparseTensorTdFiles",
1502     srcs = [
1503         "include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td",
1504         "include/mlir/Dialect/SparseTensor/IR/SparseTensorBase.td",
1505         "include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td",
1506     ],
1507     includes = ["include"],
1508     deps = [
1509         ":OpBaseTdFiles",
1510         ":SideEffectInterfacesTdFiles",
1511     ],
1514 gentbl_cc_library(
1515     name = "SparseTensorAttrDefsIncGen",
1516     strip_include_prefix = "include",
1517     tbl_outs = [
1518         (
1519             ["--gen-attrdef-decls"],
1520             "include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.h.inc",
1521         ),
1522         (
1523             ["--gen-attrdef-defs"],
1524             "include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.cpp.inc",
1525         ),
1526     ],
1527     tblgen = ":mlir-tblgen",
1528     td_file = "include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td",
1529     deps = [":SparseTensorTdFiles"],
1532 gentbl_cc_library(
1533     name = "SparseTensorOpsIncGen",
1534     strip_include_prefix = "include",
1535     tbl_outs = [
1536         (
1537             [
1538                 "-gen-dialect-decls",
1539                 "-dialect=sparse_tensor",
1540             ],
1541             "include/mlir/Dialect/SparseTensor/IR/SparseTensorOpsDialect.h.inc",
1542         ),
1543         (
1544             [
1545                 "-gen-dialect-defs",
1546                 "-dialect=sparse_tensor",
1547             ],
1548             "include/mlir/Dialect/SparseTensor/IR/SparseTensorOpsDialect.cpp.inc",
1549         ),
1550         (
1551             ["-gen-op-decls"],
1552             "include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.h.inc",
1553         ),
1554         (
1555             ["-gen-op-defs"],
1556             "include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.cpp.inc",
1557         ),
1558         (
1559             ["-gen-op-doc"],
1560             "g3doc/Dialects/SparseTensor/SparseTensor.md",
1561         ),
1562     ],
1563     tblgen = ":mlir-tblgen",
1564     td_file = "include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td",
1565     deps = [":SparseTensorTdFiles"],
1568 gentbl_cc_library(
1569     name = "SparseTensorPassIncGen",
1570     strip_include_prefix = "include",
1571     tbl_outs = [
1572         (
1573             [
1574                 "-gen-pass-decls",
1575                 "-name=SparseTensor",
1576             ],
1577             "include/mlir/Dialect/SparseTensor/Transforms/Passes.h.inc",
1578         ),
1579         (
1580             [
1581                 "-gen-pass-capi-header",
1582                 "--prefix=SparseTensor",
1583             ],
1584             "include/mlir/Dialect/SparseTensor/Transforms/Passes.capi.h.inc",
1585         ),
1586         (
1587             [
1588                 "-gen-pass-capi-impl",
1589                 "--prefix=SparseTensor",
1590             ],
1591             "include/mlir/Dialect/SparseTensor/Transforms/Passes.capi.cpp.inc",
1592         ),
1593     ],
1594     tblgen = ":mlir-tblgen",
1595     td_file = "include/mlir/Dialect/SparseTensor/Transforms/Passes.td",
1596     deps = [":PassBaseTdFiles"],
1599 cc_library(
1600     name = "SparseTensor",
1601     srcs = glob([
1602         "lib/Dialect/SparseTensor/IR/*.cpp",
1603     ]),
1604     hdrs = ["include/mlir/Dialect/SparseTensor/IR/SparseTensor.h"],
1605     includes = ["include"],
1606     deps = [
1607         ":IR",
1608         ":SideEffectInterfaces",
1609         ":SparseTensorAttrDefsIncGen",
1610         ":SparseTensorOpsIncGen",
1611         ":SparseTensorUtils",
1612         ":StandardOps",
1613         "//llvm:Support",
1614     ],
1617 cc_library(
1618     name = "SparseTensorUtils",
1619     srcs = glob(["lib/Dialect/SparseTensor/Utils/*.cpp"]),
1620     hdrs = glob(["include/mlir/Dialect/SparseTensor/Utils/*.h"]),
1621     includes = ["include"],
1622     deps = [
1623         ":IR",
1624         ":LinalgOps",
1625         ":SideEffectInterfaces",
1626         ":SparseTensorAttrDefsIncGen",
1627         ":SparseTensorOpsIncGen",
1628         ":StandardOps",
1629         "//llvm:Support",
1630     ],
1633 cc_library(
1634     name = "SparseTensorTransforms",
1635     srcs = glob(["lib/Dialect/SparseTensor/Transforms/*.cpp"]),
1636     hdrs = ["include/mlir/Dialect/SparseTensor/Transforms/Passes.h"],
1637     includes = ["include"],
1638     deps = [
1639         ":Affine",
1640         ":IR",
1641         ":LLVMDialect",
1642         ":LinalgOps",
1643         ":LinalgTransforms",
1644         ":MemRefDialect",
1645         ":Pass",
1646         ":SCFDialect",
1647         ":SparseTensor",
1648         ":SparseTensorPassIncGen",
1649         ":SparseTensorUtils",
1650         ":StandardOps",
1651         ":StandardOpsTransforms",
1652         ":TensorDialect",
1653         ":Transforms",
1654         ":VectorOps",
1655         "//llvm:Support",
1656     ],
1659 td_library(
1660     name = "StdOpsTdFiles",
1661     srcs = [
1662         "include/mlir/Dialect/StandardOps/IR/Ops.td",
1663         "include/mlir/Dialect/StandardOps/IR/StandardOpsBase.td",
1664     ],
1665     includes = ["include"],
1666     deps = [
1667         ":CallInterfacesTdFiles",
1668         ":CastInterfacesTdFiles",
1669         ":ControlFlowInterfacesTdFiles",
1670         ":OpBaseTdFiles",
1671         ":SideEffectInterfacesTdFiles",
1672         ":VectorInterfacesTdFiles",
1673     ],
1676 gentbl_cc_library(
1677     name = "StandardOpsIncGen",
1678     strip_include_prefix = "include",
1679     tbl_outs = [
1680         (
1681             ["-gen-op-decls"],
1682             "include/mlir/Dialect/StandardOps/IR/Ops.h.inc",
1683         ),
1684         (
1685             ["-gen-op-defs"],
1686             "include/mlir/Dialect/StandardOps/IR/Ops.cpp.inc",
1687         ),
1688         (
1689             ["-gen-dialect-decls"],
1690             "include/mlir/Dialect/StandardOps/IR/OpsDialect.h.inc",
1691         ),
1692         (
1693             ["-gen-dialect-defs"],
1694             "include/mlir/Dialect/StandardOps/IR/OpsDialect.cpp.inc",
1695         ),
1696         (
1697             ["-gen-enum-decls"],
1698             "include/mlir/Dialect/StandardOps/IR/OpsEnums.h.inc",
1699         ),
1700         (
1701             ["-gen-enum-defs"],
1702             "include/mlir/Dialect/StandardOps/IR/OpsEnums.cpp.inc",
1703         ),
1704     ],
1705     tblgen = ":mlir-tblgen",
1706     td_file = "include/mlir/Dialect/StandardOps/IR/Ops.td",
1707     deps = [":StdOpsTdFiles"],
1710 cc_library(
1711     name = "Dialect",
1712     srcs = glob([
1713         "lib/Dialect/*.cpp",
1714         "lib/Dialect/*.h",
1715     ]),
1716     hdrs = glob([
1717         "include/mlir/Dialect/*.h",
1718     ]),
1719     includes = ["include"],
1720     deps = [
1721         ":IR",
1722         "//llvm:Support",
1723     ],
1726 cc_library(
1727     name = "DialectUtils",
1728     srcs = glob([
1729         "lib/Dialect/Utils/*.cpp",
1730         "lib/Dialect/Utils/*.h",
1731     ]),
1732     hdrs = glob([
1733         "include/mlir/Dialect/Utils/*.h",
1734     ]),
1735     includes = ["include"],
1736     deps = [
1737         ":IR",
1738         ":Support",
1739         "//llvm:Support",
1740     ],
1743 cc_library(
1744     name = "Affine",
1745     srcs = glob(
1746         [
1747             "lib/Dialect/Affine/IR/*.cpp",
1748             "lib/Dialect/Affine/IR/*.h",
1749         ],
1750     ) + ["include/mlir/Transforms/InliningUtils.h"],
1751     hdrs = glob([
1752         "include/mlir/Dialect/Affine/IR/*.h",
1753     ]),
1754     includes = ["include"],
1755     deps = [
1756         ":AffineMemoryOpInterfacesIncGen",
1757         ":AffineOpsIncGen",
1758         ":IR",
1759         ":LoopLikeInterface",
1760         ":MemRefDialect",
1761         ":SideEffectInterfaces",
1762         ":StandardOps",
1763         ":Support",
1764         "//llvm:Support",
1765     ],
1768 cc_library(
1769     name = "EmitC",
1770     srcs = glob([
1771         "lib/Dialect/EmitC/IR/*.cpp",
1772     ]),
1773     hdrs = glob([
1774         "include/mlir/Dialect/EmitC/IR/*.h",
1775     ]),
1776     includes = ["include"],
1777     deps = [
1778         ":Dialect",
1779         ":EmitCAttributesIncGen",
1780         ":EmitCOpsIncGen",
1781         ":IR",
1782         ":SideEffectInterfaces",
1783         "//llvm:Support",
1784     ],
1787 cc_library(
1788     name = "Async",
1789     srcs = glob([
1790         "lib/Dialect/Async/IR/*.cpp",
1791     ]),
1792     hdrs = glob([
1793         "include/mlir/Dialect/Async/IR/*.h",
1794     ]),
1795     includes = ["include"],
1796     deps = [
1797         ":AsyncOpsIncGen",
1798         ":ControlFlowInterfaces",
1799         ":Dialect",
1800         ":IR",
1801         ":SideEffectInterfaces",
1802         ":StandardOps",
1803         ":Support",
1804         "//llvm:Support",
1805     ],
1808 cc_library(
1809     name = "AsyncTransforms",
1810     srcs = glob([
1811         "lib/Dialect/Async/Transforms/*.cpp",
1812         "lib/Dialect/Async/Transforms/*.h",
1813     ]),
1814     hdrs = ["include/mlir/Dialect/Async/Passes.h"],
1815     includes = ["include"],
1816     deps = [
1817         ":Analysis",
1818         ":Async",
1819         ":AsyncPassIncGen",
1820         ":IR",
1821         ":Pass",
1822         ":SCFDialect",
1823         ":SCFToStandard",
1824         ":StandardOps",
1825         ":Support",
1826         ":TransformUtils",
1827         ":Transforms",
1828         ":TransformsPassIncGen",
1829         "//llvm:Core",
1830         "//llvm:Support",
1831     ],
1834 cc_library(
1835     name = "AffineUtils",
1836     srcs = glob(
1837         [
1838             "lib/Dialect/Affine/Utils/*.cpp",
1839             "lib/Dialect/Affine/Utils/*.h",
1840         ],
1841     ),
1842     hdrs = ["include/mlir/Dialect/Affine/Utils.h"],
1843     includes = ["include"],
1844     deps = [
1845         ":Affine",
1846         ":Analysis",
1847         ":IR",
1848         ":Support",
1849         ":TransformUtils",
1850         "//llvm:Support",
1851     ],
1854 gentbl_cc_library(
1855     name = "AffinePassIncGen",
1856     strip_include_prefix = "include",
1857     tbl_outs = [
1858         (
1859             [
1860                 "-gen-pass-decls",
1861                 "-name=Affine",
1862             ],
1863             "include/mlir/Dialect/Affine/Passes.h.inc",
1864         ),
1865     ],
1866     tblgen = ":mlir-tblgen",
1867     td_file = "include/mlir/Dialect/Affine/Passes.td",
1868     deps = [":PassBaseTdFiles"],
1871 cc_library(
1872     name = "AffineTransforms",
1873     srcs = glob([
1874         "lib/Dialect/Affine/Transforms/*.cpp",
1875         "lib/Dialect/Affine/Transforms/*.h",
1876     ]),
1877     hdrs = ["include/mlir/Dialect/Affine/Passes.h"],
1878     includes = ["include"],
1879     deps = [
1880         ":Affine",
1881         ":AffinePassIncGen",
1882         ":AffineUtils",
1883         ":Analysis",
1884         ":IR",
1885         ":MemRefDialect",
1886         ":Pass",
1887         ":SCFDialect",
1888         ":StandardOps",
1889         ":Support",
1890         ":Transforms",
1891         ":VectorOps",
1892         "//llvm:Support",
1893     ],
1896 gentbl_cc_library(
1897     name = "ConversionPassIncGen",
1898     strip_include_prefix = "include",
1899     tbl_outs = [
1900         (
1901             [
1902                 "-gen-pass-decls",
1903                 "-name=Conversion",
1904             ],
1905             "include/mlir/Conversion/Passes.h.inc",
1906         ),
1907         (
1908             [
1909                 "-gen-pass-capi-header",
1910                 "--prefix=Conversion",
1911             ],
1912             "include/mlir/Conversion/Passes.capi.h.inc",
1913         ),
1914         (
1915             [
1916                 "-gen-pass-capi-impl",
1917                 "--prefix=Conversion",
1918             ],
1919             "include/mlir/Conversion/Passes.capi.cpp.inc",
1920         ),
1921     ],
1922     tblgen = ":mlir-tblgen",
1923     td_file = "include/mlir/Conversion/Passes.td",
1924     deps = [":PassBaseTdFiles"],
1927 cc_library(
1928     name = "ConversionPasses",
1929     hdrs = ["include/mlir/Conversion/Passes.h"],
1930     includes = ["include"],
1931     deps = [
1932         ":AffineToStandard",
1933         ":ArmNeon2dToIntr",
1934         ":AsyncToLLVM",
1935         ":ComplexToLLVM",
1936         ":ComplexToStandard",
1937         ":ConversionPassIncGen",
1938         ":GPUToGPURuntimeTransforms",
1939         ":GPUToNVVMTransforms",
1940         ":GPUToROCDLTransforms",
1941         ":GPUToSPIRV",
1942         ":GPUToVulkanTransforms",
1943         ":LinalgToLLVM",
1944         ":LinalgToSPIRV",
1945         ":LinalgToStandard",
1946         ":MathToLLVM",
1947         ":MathToLibm",
1948         ":MathToSPIRV",
1949         ":MemRefToLLVM",
1950         ":MemRefToSPIRV",
1951         ":OpenACCToLLVM",
1952         ":OpenACCToSCF",
1953         ":OpenMPToLLVM",
1954         ":PDLToPDLInterp",
1955         ":SCFToGPUPass",
1956         ":SCFToOpenMP",
1957         ":SCFToSPIRV",
1958         ":SCFToStandard",
1959         ":SPIRVToLLVM",
1960         ":ShapeToStandard",
1961         ":StandardToLLVM",
1962         ":StandardToSPIRV",
1963         ":TosaToLinalg",
1964         ":TosaToSCF",
1965         ":TosaToStandard",
1966         ":VectorToGPU",
1967         ":VectorToLLVM",
1968         ":VectorToROCDL",
1969         ":VectorToSCF",
1970         ":VectorToSPIRV",
1971     ],
1974 cc_library(
1975     name = "AsyncToLLVM",
1976     srcs = glob([
1977         "lib/Conversion/AsyncToLLVM/*.cpp",
1978         "lib/Conversion/AsyncToLLVM/*.h",
1979     ]) + ["lib/Conversion/PassDetail.h"],
1980     hdrs = glob(["include/mlir/Conversion/AsyncToLLVM/*.h"]),
1981     includes = ["include"],
1982     deps = [
1983         ":Async",
1984         ":ConversionPassIncGen",
1985         ":IR",
1986         ":LLVMCommonConversion",
1987         ":LLVMDialect",
1988         ":Pass",
1989         ":StandardOps",
1990         ":StandardOpsTransforms",
1991         ":StandardToLLVM",
1992         ":Support",
1993         ":Transforms",
1994         "//llvm:Support",
1995     ],
1998 cc_library(
1999     name = "AffineToStandard",
2000     srcs = glob([
2001         "lib/Conversion/AffineToStandard/*.cpp",
2002         "lib/Conversion/AffineToStandard/*.h",
2003     ]) + ["lib/Conversion/PassDetail.h"],
2004     hdrs = glob(["include/mlir/Conversion/AffineToStandard/*.h"]),
2005     includes = ["include"],
2006     deps = [
2007         ":Affine",
2008         ":ConversionPassIncGen",
2009         ":IR",
2010         ":MemRefDialect",
2011         ":Pass",
2012         ":SCFDialect",
2013         ":StandardOps",
2014         ":Support",
2015         ":Transforms",
2016         ":VectorOps",
2017     ],
2020 alias(
2021     name = "AffineToStandardTransforms",
2022     actual = "AffineToStandard",
2025 # SDBM dialect only contains attribute components that can be constructed given
2026 # a dialect object, so whenever it is used it must also be registered. Therefore
2027 # we don't split out the registration library for it.
2028 cc_library(
2029     name = "SDBM",
2030     srcs = glob([
2031         "lib/Dialect/SDBM/*.cpp",
2032         "lib/Dialect/SDBM/*.h",
2033     ]),
2034     hdrs = glob([
2035         "include/mlir/Dialect/SDBM/*.h",
2036     ]),
2037     includes = ["include"],
2038     deps = [
2039         ":IR",
2040         ":Support",
2041         "//llvm:Support",
2042     ],
2045 cc_library(
2046     name = "SCFDialect",
2047     srcs = glob(
2048         [
2049             "lib/Dialect/SCF/*.cpp",
2050             "lib/Dialect/SCF/*.h",
2051         ],
2052     ),
2053     hdrs = glob([
2054         "include/mlir/Dialect/SCF/*.h",
2055     ]),
2056     includes = ["include"],
2057     deps = [
2058         ":ControlFlowInterfaces",
2059         ":IR",
2060         ":LoopLikeInterface",
2061         ":MemRefDialect",
2062         ":Pass",
2063         ":SCFIncGen",
2064         ":SCFPassIncGen",
2065         ":StandardOps",
2066         ":Support",
2067         ":TensorDialect",
2068         "//llvm:Support",
2069     ],
2072 cc_library(
2073     name = "LinalgInterfaces",
2074     srcs = ["lib/Dialect/Linalg/IR/LinalgInterfaces.cpp"],
2075     hdrs = ["include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h"],
2076     includes = ["include"],
2077     deps = [
2078         ":Affine",
2079         ":DialectUtils",
2080         ":IR",
2081         ":InferTypeOpInterface",
2082         ":LinalgInterfacesIncGen",
2083         ":LinalgStructuredOpsIncGen",
2084         ":MemRefDialect",
2085         ":ViewLikeInterface",
2086         "//llvm:Support",
2087     ],
2090 cc_library(
2091     name = "DataLayoutInterfaces",
2092     srcs = ["lib/Interfaces/DataLayoutInterfaces.cpp"],
2093     hdrs = ["include/mlir/Interfaces/DataLayoutInterfaces.h"],
2094     includes = ["include"],
2095     deps = [
2096         ":DataLayoutInterfacesIncGen",
2097         ":IR",
2098         "//llvm:Support",
2099     ],
2102 cc_library(
2103     name = "LoopLikeInterface",
2104     srcs = ["lib/Interfaces/LoopLikeInterface.cpp"],
2105     hdrs = ["include/mlir/Interfaces/LoopLikeInterface.h"],
2106     includes = ["include"],
2107     deps = [
2108         ":IR",
2109         ":LoopLikeInterfaceIncGen",
2110     ],
2113 cc_library(
2114     name = "VectorInterfaces",
2115     srcs = ["lib/Interfaces/VectorInterfaces.cpp"],
2116     hdrs = ["include/mlir/Interfaces/VectorInterfaces.h"],
2117     includes = ["include"],
2118     deps = [
2119         ":IR",
2120         ":VectorInterfacesIncGen",
2121     ],
2124 cc_library(
2125     name = "ViewLikeInterface",
2126     srcs = ["lib/Interfaces/ViewLikeInterface.cpp"],
2127     hdrs = ["include/mlir/Interfaces/ViewLikeInterface.h"],
2128     includes = ["include"],
2129     deps = [
2130         ":DialectUtils",
2131         ":IR",
2132         ":ViewLikeInterfaceIncGen",
2133     ],
2136 cc_library(
2137     name = "CopyOpInterface",
2138     srcs = ["lib/Interfaces/CopyOpInterface.cpp"],
2139     hdrs = ["include/mlir/Interfaces/CopyOpInterface.h"],
2140     includes = ["include"],
2141     deps = [
2142         ":CopyOpInterfaceIncGen",
2143         ":IR",
2144     ],
2147 td_library(
2148     name = "ShapeOpsTdFiles",
2149     srcs = [
2150         "include/mlir/Dialect/Shape/IR/ShapeBase.td",
2151         "include/mlir/Dialect/Shape/IR/ShapeOps.td",
2152     ],
2153     includes = ["include"],
2154     deps = [
2155         ":ControlFlowInterfacesTdFiles",
2156         ":InferTypeOpInterfaceTdFiles",
2157         ":SideEffectInterfacesTdFiles",
2158     ],
2161 gentbl_cc_library(
2162     name = "ShapeOpsIncGen",
2163     strip_include_prefix = "include",
2164     tbl_outs = [
2165         (
2166             ["-gen-op-decls"],
2167             "include/mlir/Dialect/Shape/IR/ShapeOps.h.inc",
2168         ),
2169         (
2170             ["-gen-op-defs"],
2171             "include/mlir/Dialect/Shape/IR/ShapeOps.cpp.inc",
2172         ),
2173         (
2174             ["-gen-dialect-decls"],
2175             "include/mlir/Dialect/Shape/IR/ShapeOpsDialect.h.inc",
2176         ),
2177         (
2178             ["-gen-dialect-defs"],
2179             "include/mlir/Dialect/Shape/IR/ShapeOpsDialect.cpp.inc",
2180         ),
2181     ],
2182     tblgen = ":mlir-tblgen",
2183     td_file = "include/mlir/Dialect/Shape/IR/ShapeOps.td",
2184     deps = [":ShapeOpsTdFiles"],
2187 gentbl_cc_library(
2188     name = "MLIRShapeCanonicalizationIncGen",
2189     strip_include_prefix = "include/mlir/Dialect/Shape/IR",
2190     tbl_outs = [
2191         (
2192             ["-gen-rewriters"],
2193             "include/mlir/Dialect/Shape/IR/ShapeCanonicalization.inc",
2194         ),
2195     ],
2196     tblgen = ":mlir-tblgen",
2197     td_file = "lib/Dialect/Shape/IR/ShapeCanonicalization.td",
2198     deps = [
2199         ":ShapeOpsTdFiles",
2200         ":StdOpsTdFiles",
2201         ":TensorOpsTdFiles",
2202     ],
2205 cc_library(
2206     name = "Shape",
2207     srcs = glob(["lib/Dialect/Shape/IR/*.cpp"]),
2208     hdrs = ["include/mlir/Dialect/Shape/IR/Shape.h"],
2209     includes = ["include"],
2210     deps = [
2211         ":CallOpInterfaces",
2212         ":CommonFolders",
2213         ":ControlFlowInterfaces",
2214         ":Dialect",
2215         ":IR",
2216         ":InferTypeOpInterface",
2217         ":MLIRShapeCanonicalizationIncGen",
2218         ":ShapeOpsIncGen",
2219         ":SideEffectInterfaces",
2220         ":StandardOps",
2221         ":Support",
2222         ":TensorDialect",
2223         "//llvm:Support",
2224     ],
2227 gentbl_cc_library(
2228     name = "ShapeToStandardGen",
2229     strip_include_prefix = "lib/Conversion/ShapeToStandard",
2230     tbl_outs = [
2231         (
2232             ["-gen-rewriters"],
2233             "lib/Conversion/ShapeToStandard/ShapeToStandard.cpp.inc",
2234         ),
2235     ],
2236     tblgen = ":mlir-tblgen",
2237     td_file = "lib/Conversion/ShapeToStandard/ShapeToStandard.td",
2238     deps = [":ShapeOpsTdFiles"],
2241 cc_library(
2242     name = "ShapeToStandard",
2243     srcs = glob([
2244         "lib/Conversion/ShapeToStandard/*.cpp",
2245         "lib/Conversion/ShapeToStandard/*.h",
2246     ]) + ["lib/Conversion/PassDetail.h"],
2247     hdrs = ["include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h"],
2248     includes = ["include"],
2249     deps = [
2250         ":ConversionPassIncGen",
2251         ":IR",
2252         ":MemRefDialect",
2253         ":Pass",
2254         ":SCFDialect",
2255         ":Shape",
2256         ":ShapeToStandardGen",
2257         ":StandardOps",
2258         ":Support",
2259         ":TensorDialect",
2260         ":Transforms",
2261         "//llvm:Support",
2262     ],
2265 gentbl_cc_library(
2266     name = "ShapeTransformsPassIncGen",
2267     strip_include_prefix = "include",
2268     tbl_outs = [(
2269         [
2270             "-gen-pass-decls",
2271             "-name=Shape",
2272         ],
2273         "include/mlir/Dialect/Shape/Transforms/Passes.h.inc",
2274     )],
2275     tblgen = ":mlir-tblgen",
2276     td_file = "include/mlir/Dialect/Shape/Transforms/Passes.td",
2277     deps = [":PassBaseTdFiles"],
2280 cc_library(
2281     name = "ShapeTransforms",
2282     srcs = glob([
2283         "lib/Dialect/Shape/Transforms/*.cpp",
2284         "lib/Dialect/Shape/Transforms/*.h",
2285     ]),
2286     hdrs = ["include/mlir/Dialect/Shape/Transforms/Passes.h"],
2287     includes = ["include"],
2288     deps = [
2289         ":IR",
2290         ":MemRefDialect",
2291         ":Pass",
2292         ":Shape",
2293         ":ShapeTransformsPassIncGen",
2294         ":StandardOps",
2295         ":Transforms",
2296     ],
2299 cc_library(
2300     name = "StandardOps",
2301     srcs = glob(
2302         [
2303             "lib/Dialect/StandardOps/IR/*.cpp",
2304             "lib/Dialect/StandardOps/IR/*.h",
2305             "lib/Dialect/StandardOps/Utils/*.cpp",
2306         ],
2307     ),
2308     hdrs = glob([
2309         "include/mlir/Dialect/StandardOps/IR/*.h",
2310         "include/mlir/Dialect/StandardOps/Utils/*.h",
2311     ]) + ["include/mlir/Transforms/InliningUtils.h"],
2312     includes = ["include"],
2313     deps = [
2314         ":CallOpInterfaces",
2315         ":CastOpInterfaces",
2316         ":CommonFolders",
2317         ":ControlFlowInterfaces",
2318         ":IR",
2319         ":SideEffectInterfaces",
2320         ":StandardOpsIncGen",
2321         ":Support",
2322         ":VectorInterfaces",
2323         "//llvm:Support",
2324     ],
2327 gentbl_cc_library(
2328     name = "StandardOpsTransformsPassIncGen",
2329     strip_include_prefix = "include",
2330     tbl_outs = [(
2331         [
2332             "-gen-pass-decls",
2333             "-name=Standard",
2334         ],
2335         "include/mlir/Dialect/StandardOps/Transforms/Passes.h.inc",
2336     )],
2337     tblgen = ":mlir-tblgen",
2338     td_file = "include/mlir/Dialect/StandardOps/Transforms/Passes.td",
2339     deps = [":PassBaseTdFiles"],
2342 cc_library(
2343     name = "StandardOpsTransforms",
2344     srcs = glob([
2345         "lib/Dialect/StandardOps/Transforms/*.cpp",
2346         "lib/Dialect/StandardOps/Transforms/*.h",
2347     ]),
2348     hdrs = glob(["include/mlir/Dialect/StandardOps/Transforms/*.h"]),
2349     includes = ["include"],
2350     deps = [
2351         ":Affine",
2352         ":IR",
2353         ":MemRefDialect",  # TODO: Remove dependency on MemRef dialect
2354         ":Pass",
2355         ":SCFDialect",
2356         ":StandardOps",
2357         ":StandardOpsTransformsPassIncGen",
2358         ":Support",
2359         ":TensorDialect",
2360         ":Transforms",
2361         "//llvm:Support",
2362     ],
2365 cc_library(
2366     name = "VectorOps",
2367     srcs = glob(
2368         [
2369             "lib/Dialect/Vector/*.cpp",
2370             "lib/Dialect/Vector/*.h",
2371         ],
2372     ),
2373     hdrs = glob([
2374         "include/mlir/Dialect/Vector/*.h",
2375     ]),
2376     includes = ["include"],
2377     deps = [
2378         ":Affine",
2379         ":AffineUtils",
2380         ":Analysis",
2381         ":DataLayoutInterfaces",
2382         ":DialectUtils",
2383         ":IR",
2384         ":LinalgOps",
2385         ":MemRefDialect",
2386         ":SCFDialect",
2387         ":SideEffectInterfaces",
2388         ":StandardOps",
2389         ":Support",
2390         ":TensorDialect",
2391         ":VectorInterfaces",
2392         ":VectorOpsIncGen",
2393         ":ViewLikeInterface",
2394         "//llvm:Support",
2395     ],
2398 cc_library(
2399     name = "Support",
2400     srcs = glob(
2401         [
2402             "lib/Support/*.cpp",
2403             "lib/Support/*.h",
2404         ],
2405         exclude = [
2406             # TODO(jpienaar): Move this out, else Support depends on Analysis/
2407             "lib/Support/MlirOptMain.cpp",
2408         ],
2409     ),
2410     hdrs = glob(
2411         ["include/mlir/Support/*.h"],
2412         exclude = ["include/mlir/Support/MlirOptMain.h"],
2413     ),
2414     includes = ["include"],
2415     deps = ["//llvm:Support"],
2418 cc_library(
2419     name = "MlirLspServerLib",
2420     srcs = glob(
2421         [
2422             "lib/Tools/mlir-lsp-server/*.cpp",
2423             "lib/Tools/mlir-lsp-server/*.h",
2424             "lib/Tools/mlir-lsp-server/lsp/*.cpp",
2425             "lib/Tools/mlir-lsp-server/lsp/*.h",
2426         ],
2427     ),
2428     hdrs = glob(
2429         ["include/mlir/Tools/mlir-lsp-server/*.h"],
2430     ),
2431     includes = ["include"],
2432     deps = [
2433         ":IR",
2434         ":Parser",
2435         ":Support",
2436         "//llvm:Support",
2437     ],
2440 cc_library(
2441     name = "ParserTokenKinds",
2442     # strip_include_prefix does not apply to textual_hdrs.
2443     hdrs = ["lib/Parser/TokenKinds.def"],
2444     strip_include_prefix = "lib/Parser",
2445     textual_hdrs = ["lib/Parser/TokenKinds.def"],
2448 cc_library(
2449     name = "Parser",
2450     srcs = glob([
2451         "lib/Parser/*.cpp",
2452         "lib/Parser/*.h",
2453     ]),
2454     hdrs = glob([
2455         "include/mlir/Parser/*.h",
2456     ]) + [
2457         "include/mlir/Parser.h",
2458     ],
2459     includes = ["include"],
2460     deps = [
2461         ":IR",
2462         ":ParserTokenKinds",
2463         ":Support",
2464         "//llvm:Support",
2465     ],
2468 gentbl_cc_library(
2469     name = "LLVMDialectInterfaceIncGen",
2470     strip_include_prefix = "include",
2471     tbl_outs = [
2472         (
2473             ["-gen-op-interface-decls"],
2474             "include/mlir/Dialect/LLVMIR/LLVMOpsInterfaces.h.inc",
2475         ),
2476         (
2477             ["-gen-op-interface-defs"],
2478             "include/mlir/Dialect/LLVMIR/LLVMOpsInterfaces.cpp.inc",
2479         ),
2480         (
2481             ["-gen-type-interface-decls"],
2482             "include/mlir/Dialect/LLVMIR/LLVMTypeInterfaces.h.inc",
2483         ),
2484         (
2485             ["-gen-type-interface-defs"],
2486             "include/mlir/Dialect/LLVMIR/LLVMTypeInterfaces.cpp.inc",
2487         ),
2488     ],
2489     tblgen = ":mlir-tblgen",
2490     td_file = "include/mlir/Dialect/LLVMIR/LLVMOpsInterfaces.td",
2491     deps = [":LLVMOpsTdFiles"],
2494 gentbl_cc_library(
2495     name = "LLVMDialectAttributesIncGen",
2496     strip_include_prefix = "include",
2497     tbl_outs = [
2498         (
2499             ["--gen-attrdef-decls"],
2500             "include/mlir/Dialect/LLVMIR/LLVMOpsAttrDefs.h.inc",
2501         ),
2502         (
2503             ["--gen-attrdef-defs"],
2504             "include/mlir/Dialect/LLVMIR/LLVMOpsAttrDefs.cpp.inc",
2505         ),
2506     ],
2507     tblgen = ":mlir-tblgen",
2508     td_file = "include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td",
2509     deps = [":LLVMOpsTdFiles"],
2512 cc_library(
2513     name = "LLVMDialect",
2514     srcs = glob(
2515         [
2516             "lib/Dialect/LLVMIR/IR/*.cpp",
2517             "lib/Dialect/LLVMIR/IR/*.h",
2518         ],
2519         exclude = [
2520             "lib/Dialect/LLVMIR/IR/*AMX*.cpp",
2521             "lib/Dialect/LLVMIR/IR/*AMX*.h",
2522             "lib/Dialect/LLVMIR/IR/*ArmSVE*.cpp",
2523             "lib/Dialect/LLVMIR/IR/*ArmSVE*.h",
2524             "lib/Dialect/LLVMIR/IR/NVVM*.cpp",
2525             "lib/Dialect/LLVMIR/IR/NVVM*.h",
2526             "lib/Dialect/LLVMIR/IR/ROCDL*.cpp",
2527             "lib/Dialect/LLVMIR/IR/ROCDL*.h",
2528             "lib/Dialect/LLVMIR/IR/*X86Vector*.cpp",
2529             "lib/Dialect/LLVMIR/IR/*X86Vector*.h",
2530         ],
2531     ),
2532     hdrs = glob(
2533         ["include/mlir/Dialect/LLVMIR/*.h"],
2534         exclude = [
2535             "include/mlir/Dialect/LLVMIR/*AMX*.h",
2536             "include/mlir/Dialect/LLVMIR/*ArmSVE*.h",
2537             "include/mlir/Dialect/LLVMIR/NVVM*.h",
2538             "include/mlir/Dialect/LLVMIR/ROCDL*.h",
2539             "include/mlir/Dialect/LLVMIR/*X86Vector*.h",
2540         ],
2541     ),
2542     includes = ["include"],
2543     deps = [
2544         ":ControlFlowInterfaces",
2545         ":DataLayoutInterfaces",
2546         ":IR",
2547         ":LLVMDialectAttributesIncGen",
2548         ":LLVMDialectInterfaceIncGen",
2549         ":LLVMOpsIncGen",
2550         ":SideEffectInterfaces",
2551         ":Support",
2552         "//llvm:AsmParser",
2553         "//llvm:BitReader",
2554         "//llvm:BitWriter",
2555         "//llvm:Core",
2556         "//llvm:Support",
2557     ],
2560 gentbl_cc_library(
2561     name = "LLVMPassIncGen",
2562     strip_include_prefix = "include",
2563     tbl_outs = [
2564         (
2565             [
2566                 "-gen-pass-decls",
2567                 "-name=LLVM",
2568             ],
2569             "include/mlir/Dialect/LLVMIR/Transforms/Passes.h.inc",
2570         ),
2571     ],
2572     tblgen = ":mlir-tblgen",
2573     td_file = "include/mlir/Dialect/LLVMIR/Transforms/Passes.td",
2574     deps = [":PassBaseTdFiles"],
2577 cc_library(
2578     name = "LLVMIRTransforms",
2579     srcs = glob([
2580         "lib/Dialect/LLVMIR/Transforms/*.cpp",
2581         "lib/Dialect/LLVMIR/Transforms/*.h",
2582     ]),
2583     hdrs = glob(["include/mlir/Dialect/LLVMIR/Transforms/*.h"]),
2584     includes = ["include"],
2585     deps = [
2586         ":IR",
2587         ":LLVMDialect",
2588         ":LLVMPassIncGen",
2589         ":Pass",
2590     ],
2593 td_library(
2594     name = "GPUOpsTdFiles",
2595     srcs = [
2596         "include/mlir/Dialect/GPU/GPUBase.td",
2597         "include/mlir/Dialect/GPU/GPUOps.td",
2598     ],
2599     includes = ["include"],
2600     deps = [
2601         ":DLTIDialectTdFiles",
2602         ":DataLayoutInterfacesTdFiles",
2603         ":LLVMOpsTdFiles",
2604         ":OpBaseTdFiles",
2605         ":SideEffectInterfacesTdFiles",
2606     ],
2609 gentbl_cc_library(
2610     name = "ParallelLoopMapperAttrGen",
2611     strip_include_prefix = "include",
2612     tbl_outs = [
2613         (
2614             ["-gen-struct-attr-decls"],
2615             "include/mlir/Dialect/GPU/ParallelLoopMapperAttr.h.inc",
2616         ),
2617         (
2618             ["-gen-struct-attr-defs"],
2619             "include/mlir/Dialect/GPU/ParallelLoopMapperAttr.cpp.inc",
2620         ),
2621         (
2622             ["-gen-enum-decls"],
2623             "include/mlir/Dialect/GPU/ParallelLoopMapperEnums.h.inc",
2624         ),
2625         (
2626             ["-gen-enum-defs"],
2627             "include/mlir/Dialect/GPU/ParallelLoopMapperEnums.cpp.inc",
2628         ),
2629     ],
2630     tblgen = ":mlir-tblgen",
2631     td_file = "include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td",
2632     deps = [":GPUOpsTdFiles"],
2635 gentbl_cc_library(
2636     name = "GPUBaseIncGen",
2637     strip_include_prefix = "include",
2638     tbl_outs = [
2639         (
2640             [
2641                 "-gen-dialect-decls",
2642                 "-dialect=gpu",
2643             ],
2644             "include/mlir/Dialect/GPU/GPUOpsDialect.h.inc",
2645         ),
2646         (
2647             [
2648                 "-gen-dialect-defs",
2649                 "-dialect=gpu",
2650             ],
2651             "include/mlir/Dialect/GPU/GPUOpsDialect.cpp.inc",
2652         ),
2653         (
2654             ["-gen-op-interface-decls"],
2655             "include/mlir/Dialect/GPU/GPUOpInterfaces.h.inc",
2656         ),
2657         (
2658             ["-gen-op-interface-defs"],
2659             "include/mlir/Dialect/GPU/GPUOpInterfaces.cpp.inc",
2660         ),
2661     ],
2662     tblgen = ":mlir-tblgen",
2663     td_file = "include/mlir/Dialect/GPU/GPUBase.td",
2664     deps = [":GPUOpsTdFiles"],
2667 gentbl_cc_library(
2668     name = "GPUOpsIncGen",
2669     strip_include_prefix = "include",
2670     tbl_outs = [
2671         (
2672             ["-gen-op-decls"],
2673             "include/mlir/Dialect/GPU/GPUOps.h.inc",
2674         ),
2675         (
2676             ["-gen-op-defs"],
2677             "include/mlir/Dialect/GPU/GPUOps.cpp.inc",
2678         ),
2679     ],
2680     tblgen = ":mlir-tblgen",
2681     td_file = "include/mlir/Dialect/GPU/GPUOps.td",
2682     deps = [
2683         ":DLTIDialectTdFiles",
2684         ":GPUOpsTdFiles",
2685     ],
2688 cc_library(
2689     name = "GPUDialect",
2690     srcs = glob(
2691         [
2692             "lib/Dialect/GPU/IR/*.cpp",
2693             "lib/Dialect/GPU/IR/*.h",
2694         ],
2695     ),
2696     hdrs = ["include/mlir/Dialect/GPU/GPUDialect.h"],
2697     includes = ["include"],
2698     deps = [
2699         ":DLTIDialect",
2700         ":GPUBaseIncGen",
2701         ":GPUOpsIncGen",
2702         ":IR",
2703         ":LLVMDialect",
2704         ":MemRefDialect",
2705         ":SideEffectInterfaces",
2706         ":StandardOps",
2707         ":Support",
2708         "//llvm:Support",
2709     ],
2712 gentbl_cc_library(
2713     name = "GPUPassIncGen",
2714     strip_include_prefix = "include",
2715     tbl_outs = [
2716         (
2717             [
2718                 "-gen-pass-decls",
2719                 "-name=GPU",
2720             ],
2721             "include/mlir/Dialect/GPU/Passes.h.inc",
2722         ),
2723         (
2724             [
2725                 "-gen-pass-capi-header",
2726                 "--prefix=GPU",
2727             ],
2728             "include/mlir/Dialect/GPU/Passes.capi.h.inc",
2729         ),
2730         (
2731             [
2732                 "-gen-pass-capi-impl",
2733                 "--prefix=GPU",
2734             ],
2735             "include/mlir/Dialect/GPU/Passes.capi.cpp.inc",
2736         ),
2737     ],
2738     tblgen = ":mlir-tblgen",
2739     td_file = "include/mlir/Dialect/GPU/Passes.td",
2740     deps = [":PassBaseTdFiles"],
2743 cc_library(
2744     name = "GPUTransforms",
2745     srcs = glob(
2746         [
2747             "lib/Dialect/GPU/Transforms/*.cpp",
2748             "lib/Dialect/GPU/Transforms/*.h",
2749         ],
2750     ),
2751     hdrs = [
2752         "include/mlir/Dialect/GPU/MemoryPromotion.h",
2753         "include/mlir/Dialect/GPU/ParallelLoopMapper.h",
2754         "include/mlir/Dialect/GPU/Passes.h",
2755         "include/mlir/Dialect/GPU/Utils.h",
2756     ],
2757     defines = if_cuda_available(["MLIR_GPU_TO_CUBIN_PASS_ENABLE"]),
2758     includes = ["include"],
2759     deps = [
2760         ":Async",
2761         ":GPUDialect",
2762         ":GPUPassIncGen",
2763         ":MemRefDialect",
2764         ":IR",
2765         ":ParallelLoopMapperAttrGen",
2766         ":Pass",
2767         ":SCFDialect",
2768         ":StandardOps",
2769         ":Support",
2770         ":Transforms",
2771         ":ToLLVMIRTranslation",
2772         ":LLVMToLLVMIRTranslation",
2773         "//llvm:Core",
2774         "//llvm:Support",
2775         "//llvm:Target",
2776     ] + if_cuda_available([
2777         # Dependencies for SerializeToCubin.cpp with
2778         # -DMLIR_GPU_TO_CUBIN_PASS_ENABLE
2779         ":NVVMToLLVMIRTranslation",
2780         "//llvm:NVPTXCodeGen",
2781         "@cuda//:cuda_headers",
2782         "@cuda//:libcuda",
2783     ]),
2786 td_library(
2787     name = "LLVMOpsTdFiles",
2788     srcs = [
2789         "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
2790         "include/mlir/Dialect/LLVMIR/LLVMOps.td",
2791         "include/mlir/Dialect/LLVMIR/LLVMOpsInterfaces.td",
2792     ],
2793     includes = ["include"],
2794     deps = [
2795         ":ControlFlowInterfacesTdFiles",
2796         ":OpBaseTdFiles",
2797         ":SideEffectInterfacesTdFiles",
2798     ],
2801 cc_library(
2802     name = "GPUCommonTransforms",
2803     srcs = [
2804         "lib/Conversion/GPUCommon/GPUOpsLowering.cpp",
2805     ],
2806     hdrs = [
2807         "lib/Conversion/GPUCommon/GPUOpsLowering.h",
2808         "lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h",
2809         "lib/Conversion/GPUCommon/OpToFuncCallLowering.h",
2810     ],
2811     deps = [
2812         ":GPUDialect",
2813         ":IR",
2814         ":LLVMCommonConversion",
2815         ":LLVMDialect",
2816         ":StandardOps",
2817         "//llvm:Support",
2818     ],
2821 gentbl_cc_library(
2822     name = "GPUToNVVMGen",
2823     strip_include_prefix = "lib/Conversion/GPUToNVVM",
2824     tbl_outs = [
2825         (
2826             ["-gen-rewriters"],
2827             "lib/Conversion/GPUToNVVM/GPUToNVVM.cpp.inc",
2828         ),
2829     ],
2830     tblgen = ":mlir-tblgen",
2831     td_file = "lib/Conversion/GPUToNVVM/GPUToNVVM.td",
2832     deps = [
2833         ":GPUOpsTdFiles",
2834         ":NVVMOpsTdFiles",
2835     ],
2838 cc_library(
2839     name = "GPUToNVVMTransforms",
2840     srcs = glob([
2841         "lib/Conversion/GPUToNVVM/*.cpp",
2842         "lib/Conversion/GPUToNVVM/*.h",
2843     ]) + ["lib/Conversion/PassDetail.h"],
2844     hdrs = glob([
2845         "include/mlir/Conversion/GPUToNVVM/*.h",
2846     ]),
2847     includes = ["include"],
2848     deps = [
2849         ":ConversionPassIncGen",
2850         ":GPUCommonTransforms",
2851         ":GPUDialect",
2852         ":GPUToNVVMGen",
2853         ":GPUTransforms",
2854         ":IR",
2855         ":LLVMCommonConversion",
2856         ":LLVMDialect",
2857         ":MathDialect",
2858         ":MemRefDialect",
2859         ":MemRefToLLVM",
2860         ":NVVMDialect",
2861         ":Pass",
2862         ":StandardToLLVM",
2863         ":Transforms",
2864         "//llvm:Support",
2865     ],
2868 cc_library(
2869     name = "VectorToROCDL",
2870     srcs = [
2871         "lib/Conversion/PassDetail.h",
2872         "lib/Conversion/VectorToROCDL/VectorToROCDL.cpp",
2873     ],
2874     hdrs = ["include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h"],
2875     includes = ["include"],
2876     deps = [
2877         ":ConversionPassIncGen",
2878         ":GPUDialect",
2879         ":LLVMCommonConversion",
2880         ":LLVMDialect",
2881         ":MemRefToLLVM",
2882         ":Pass",
2883         ":ROCDLDialect",
2884         ":StandardOps",
2885         ":StandardToLLVM",
2886         ":Transforms",
2887         ":VectorOps",
2888     ],
2891 cc_library(
2892     name = "VectorToSPIRV",
2893     srcs = glob([
2894         "lib/Conversion/VectorToSPIRV/*.cpp",
2895         "lib/Conversion/VectorToSPIRV/*.h",
2896     ]) + ["lib/Conversion/PassDetail.h"],
2897     hdrs = glob([
2898         "include/mlir/Conversion/VectorToSPIRV/*.h",
2899     ]),
2900     includes = ["include"],
2901     deps = [
2902         ":ConversionPassIncGen",
2903         ":Pass",
2904         ":SPIRVConversion",
2905         ":SPIRVDialect",
2906         ":Transforms",
2907         ":VectorOps",
2908     ],
2911 gentbl_cc_library(
2912     name = "GPUToROCDLTGen",
2913     strip_include_prefix = "lib/Conversion/GPUToROCDL",
2914     tbl_outs = [
2915         (
2916             ["-gen-rewriters"],
2917             "lib/Conversion/GPUToROCDL/GPUToROCDL.cpp.inc",
2918         ),
2919     ],
2920     tblgen = ":mlir-tblgen",
2921     td_file = "lib/Conversion/GPUToROCDL/GPUToROCDL.td",
2922     deps = [
2923         ":GPUOpsTdFiles",
2924         ":ROCDLOpsTdFiles",
2925     ],
2928 cc_library(
2929     name = "GPUToROCDLTransforms",
2930     srcs = [
2931         "lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp",
2932         "lib/Conversion/PassDetail.h",
2933     ],
2934     hdrs = ["include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"],
2935     includes = ["include"],
2936     deps = [
2937         ":ConversionPassIncGen",
2938         ":GPUCommonTransforms",
2939         ":GPUDialect",
2940         ":GPUToROCDLTGen",
2941         ":GPUTransforms",
2942         ":LLVMCommonConversion",
2943         ":MathDialect",
2944         ":MemRefToLLVM",
2945         ":Pass",
2946         ":ROCDLDialect",
2947         ":StandardToLLVM",
2948         ":Transforms",
2949         ":VectorOps",
2950         ":VectorToLLVM",
2951         ":VectorToROCDL",
2952         ":VectorToSCF",
2953         "//llvm:Support",
2954     ],
2957 cc_library(
2958     name = "GPUToVulkanTransforms",
2959     srcs = [
2960         "lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp",
2961         "lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp",
2962         "lib/Conversion/PassDetail.h",
2963     ],
2964     hdrs = ["include/mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"],
2965     includes = ["include"],
2966     deps = [
2967         ":ConversionPassIncGen",
2968         ":GPUDialect",
2969         ":IR",
2970         ":LLVMDialect",
2971         ":Pass",
2972         ":SPIRVDialect",
2973         ":SPIRVSerialization",
2974         ":StandardOps",
2975         ":Support",
2976         "//llvm:Support",
2977     ],
2980 cc_library(
2981     name = "GPUToGPURuntimeTransforms",
2982     srcs = [
2983         "lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp",
2984         "lib/Conversion/PassDetail.h",
2985     ],
2986     hdrs = ["include/mlir/Conversion/GPUCommon/GPUCommonPass.h"],
2987     includes = ["include"],
2988     deps = [
2989         ":Async",
2990         ":AsyncToLLVM",
2991         ":ConversionPassIncGen",
2992         ":GPUDialect",
2993         ":GPUTransforms",
2994         ":IR",
2995         ":LLVMCommonConversion",
2996         ":LLVMDialect",
2997         ":MemRefToLLVM",
2998         ":NVVMToLLVMIRTranslation",
2999         ":Pass",
3000         ":StandardToLLVM",
3001         ":Support",
3002         ":VectorToLLVM",
3003         "//llvm:Support",
3004     ],
3007 cc_library(
3008     name = "GPUToSPIRV",
3009     srcs = glob([
3010         "lib/Conversion/GPUToSPIRV/*.cpp",
3011         "lib/Conversion/GPUToSPIRV/*.h",
3012     ]) + ["lib/Conversion/PassDetail.h"],
3013     hdrs = glob([
3014         "include/mlir/Conversion/GPUToSPIRV/*.h",
3015     ]),
3016     includes = [
3017         "include",
3018         "lib/Conversions/GPUToSPIRV",
3019     ],
3020     deps = [
3021         ":ConversionPassIncGen",
3022         ":GPUDialect",
3023         ":IR",
3024         ":MemRefToSPIRV",
3025         ":Pass",
3026         ":SCFDialect",
3027         ":SCFToSPIRV",
3028         ":SPIRVConversion",
3029         ":SPIRVDialect",
3030         ":StandardToSPIRV",
3031         ":Support",
3032         ":Transforms",
3033         ":VectorToSPIRV",
3034         "//llvm:Support",
3035     ],
3038 cc_library(
3039     name = "PDLToPDLInterp",
3040     srcs = glob([
3041         "lib/Conversion/PDLToPDLInterp/*.cpp",
3042         "lib/Conversion/PDLToPDLInterp/*.h",
3043     ]) + ["lib/Conversion/PassDetail.h"],
3044     hdrs = ["include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h"],
3045     includes = ["include"],
3046     deps = [
3047         ":ConversionPassIncGen",
3048         ":IR",
3049         ":InferTypeOpInterface",
3050         ":PDLDialect",
3051         ":PDLInterpDialect",
3052         ":Pass",
3053         ":Support",
3054         "//llvm:Support",
3055     ],
3058 cc_library(
3059     name = "SPIRVToLLVM",
3060     srcs = glob([
3061         "lib/Conversion/SPIRVToLLVM/*.cpp",
3062     ]) + ["lib/Conversion/PassDetail.h"],
3063     hdrs = glob([
3064         "include/mlir/Conversion/SPIRVToLLVM/*.h",
3065     ]),
3066     includes = ["include"],
3067     deps = [
3068         ":ConversionPassIncGen",
3069         ":GPUDialect",
3070         ":IR",
3071         ":LLVMCommonConversion",
3072         ":LLVMDialect",
3073         ":MemRefToLLVM",
3074         ":Pass",
3075         ":SPIRVDialect",
3076         ":SPIRVUtils",
3077         ":StandardOps",
3078         ":StandardToLLVM",
3079         ":Support",
3080         ":Transforms",
3081         "//llvm:Support",
3082     ],
3085 gentbl_cc_library(
3086     name = "LLVMOpsIncGen",
3087     strip_include_prefix = "include",
3088     tbl_outs = [
3089         (
3090             ["-gen-op-decls"],
3091             "include/mlir/Dialect/LLVMIR/LLVMOps.h.inc",
3092         ),
3093         (
3094             ["-gen-op-defs"],
3095             "include/mlir/Dialect/LLVMIR/LLVMOps.cpp.inc",
3096         ),
3097         (
3098             ["-gen-dialect-decls"],
3099             "include/mlir/Dialect/LLVMIR/LLVMOpsDialect.h.inc",
3100         ),
3101         (
3102             ["-gen-dialect-defs"],
3103             "include/mlir/Dialect/LLVMIR/LLVMOpsDialect.cpp.inc",
3104         ),
3105         (
3106             ["-gen-enum-decls"],
3107             "include/mlir/Dialect/LLVMIR/LLVMOpsEnums.h.inc",
3108         ),
3109         (
3110             ["-gen-enum-defs"],
3111             "include/mlir/Dialect/LLVMIR/LLVMOpsEnums.cpp.inc",
3112         ),
3113     ],
3114     tblgen = ":mlir-tblgen",
3115     td_file = "include/mlir/Dialect/LLVMIR/LLVMOps.td",
3116     deps = [":LLVMOpsTdFiles"],
3119 gentbl_cc_library(
3120     name = "LLVMConversionIncGen",
3121     strip_include_prefix = "include",
3122     tbl_outs = [
3123         (
3124             ["-gen-llvmir-conversions"],
3125             "include/mlir/Dialect/LLVMIR/LLVMConversions.inc",
3126         ),
3127         (
3128             ["-gen-enum-to-llvmir-conversions"],
3129             "include/mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc",
3130         ),
3131         (
3132             ["-gen-enum-from-llvmir-conversions"],
3133             "include/mlir/Dialect/LLVMIR/LLVMConversionEnumsFromLLVM.inc",
3134         ),
3135     ],
3136     tblgen = ":mlir-tblgen",
3137     td_file = "include/mlir/Dialect/LLVMIR/LLVMOps.td",
3138     deps = [":LLVMOpsTdFiles"],
3141 cc_library(
3142     name = "NVVMDialect",
3143     srcs = ["lib/Dialect/LLVMIR/IR/NVVMDialect.cpp"],
3144     hdrs = ["include/mlir/Dialect/LLVMIR/NVVMDialect.h"],
3145     includes = ["include"],
3146     deps = [
3147         ":IR",
3148         ":LLVMDialect",
3149         ":NVVMOpsIncGen",
3150         ":SideEffectInterfaces",
3151         ":StandardOps",
3152         ":Support",
3153         "//llvm:AsmParser",
3154         "//llvm:Core",
3155         "//llvm:Support",
3156     ],
3159 td_library(
3160     name = "NVVMOpsTdFiles",
3161     srcs = ["include/mlir/Dialect/LLVMIR/NVVMOps.td"],
3162     includes = ["include"],
3163     deps = [
3164         ":LLVMOpsTdFiles",
3165         ":OpBaseTdFiles",
3166         ":SideEffectInterfacesTdFiles",
3167     ],
3170 gentbl_cc_library(
3171     name = "NVVMOpsIncGen",
3172     strip_include_prefix = "include",
3173     tbl_outs = [
3174         (
3175             ["-gen-op-decls"],
3176             "include/mlir/Dialect/LLVMIR/NVVMOps.h.inc",
3177         ),
3178         (
3179             ["-gen-op-defs"],
3180             "include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc",
3181         ),
3182         (
3183             [
3184                 "-gen-dialect-decls",
3185                 "-dialect=nvvm",
3186             ],
3187             "include/mlir/Dialect/LLVMIR/NVVMOpsDialect.h.inc",
3188         ),
3189         (
3190             [
3191                 "-gen-dialect-defs",
3192                 "-dialect=nvvm",
3193             ],
3194             "include/mlir/Dialect/LLVMIR/NVVMOpsDialect.cpp.inc",
3195         ),
3196     ],
3197     tblgen = ":mlir-tblgen",
3198     td_file = "include/mlir/Dialect/LLVMIR/NVVMOps.td",
3199     deps = [":NVVMOpsTdFiles"],
3202 gentbl_cc_library(
3203     name = "NVVMConversionIncGen",
3204     strip_include_prefix = "include",
3205     tbl_outs = [
3206         (
3207             ["-gen-llvmir-conversions"],
3208             "include/mlir/Dialect/LLVMIR/NVVMConversions.inc",
3209         ),
3210     ],
3211     tblgen = ":mlir-tblgen",
3212     td_file = "include/mlir/Dialect/LLVMIR/NVVMOps.td",
3213     deps = [":NVVMOpsTdFiles"],
3216 cc_library(
3217     name = "ROCDLDialect",
3218     srcs = ["lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp"],
3219     hdrs = ["include/mlir/Dialect/LLVMIR/ROCDLDialect.h"],
3220     includes = ["include"],
3221     deps = [
3222         ":IR",
3223         ":LLVMDialect",
3224         ":ROCDLOpsIncGen",
3225         ":SideEffectInterfaces",
3226         ":StandardOps",
3227         ":Support",
3228         "//llvm:AsmParser",
3229         "//llvm:Core",
3230         "//llvm:Support",
3231     ],
3234 td_library(
3235     name = "ROCDLOpsTdFiles",
3236     srcs = ["include/mlir/Dialect/LLVMIR/ROCDLOps.td"],
3237     includes = ["include"],
3238     deps = [
3239         ":LLVMOpsTdFiles",
3240         ":OpBaseTdFiles",
3241         ":SideEffectInterfacesTdFiles",
3242     ],
3245 gentbl_cc_library(
3246     name = "ROCDLOpsIncGen",
3247     strip_include_prefix = "include",
3248     tbl_outs = [
3249         (
3250             ["-gen-op-decls"],
3251             "include/mlir/Dialect/LLVMIR/ROCDLOps.h.inc",
3252         ),
3253         (
3254             ["-gen-op-defs"],
3255             "include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc",
3256         ),
3257         (
3258             [
3259                 "-gen-dialect-decls",
3260                 "-dialect=rocdl",
3261             ],
3262             "include/mlir/Dialect/LLVMIR/ROCDLOpsDialect.h.inc",
3263         ),
3264         (
3265             [
3266                 "-gen-dialect-defs",
3267                 "-dialect=rocdl",
3268             ],
3269             "include/mlir/Dialect/LLVMIR/ROCDLOpsDialect.cpp.inc",
3270         ),
3271     ],
3272     tblgen = ":mlir-tblgen",
3273     td_file = "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
3274     deps = [":ROCDLOpsTdFiles"],
3277 gentbl_cc_library(
3278     name = "ROCDLConversionIncGen",
3279     strip_include_prefix = "include",
3280     tbl_outs = [
3281         (
3282             ["-gen-llvmir-conversions"],
3283             "include/mlir/Dialect/LLVMIR/ROCDLConversions.inc",
3284         ),
3285     ],
3286     tblgen = ":mlir-tblgen",
3287     td_file = "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
3288     deps = [":ROCDLOpsTdFiles"],
3291 cc_library(
3292     name = "PDLDialect",
3293     srcs = glob([
3294         "lib/Dialect/PDL/IR/*.cpp",
3295         "lib/Dialect/PDL/IR/*.h",
3296     ]),
3297     hdrs = glob([
3298         "include/mlir/Dialect/PDL/IR/*.h",
3299     ]),
3300     includes = ["include"],
3301     deps = [
3302         ":IR",
3303         ":InferTypeOpInterface",
3304         ":PDLOpsIncGen",
3305         ":PDLTypesIncGen",
3306         ":SideEffects",
3307         ":Support",
3308         "//llvm:Support",
3309     ],
3312 td_library(
3313     name = "PDLDialectTdFiles",
3314     srcs = [
3315         "include/mlir/Dialect/PDL/IR/PDLDialect.td",
3316         "include/mlir/Dialect/PDL/IR/PDLOps.td",
3317         "include/mlir/Dialect/PDL/IR/PDLTypes.td",
3318     ],
3319     deps = [
3320         ":OpBaseTdFiles",
3321         ":SideEffectInterfacesTdFiles",
3322     ],
3325 gentbl_cc_library(
3326     name = "PDLOpsIncGen",
3327     strip_include_prefix = "include",
3328     tbl_outs = [
3329         (
3330             ["-gen-op-decls"],
3331             "include/mlir/Dialect/PDL/IR/PDLOps.h.inc",
3332         ),
3333         (
3334             ["-gen-op-defs"],
3335             "include/mlir/Dialect/PDL/IR/PDLOps.cpp.inc",
3336         ),
3337         (
3338             ["-gen-dialect-decls"],
3339             "include/mlir/Dialect/PDL/IR/PDLOpsDialect.h.inc",
3340         ),
3341         (
3342             ["-gen-dialect-defs"],
3343             "include/mlir/Dialect/PDL/IR/PDLOpsDialect.cpp.inc",
3344         ),
3345     ],
3346     tblgen = ":mlir-tblgen",
3347     td_file = "include/mlir/Dialect/PDL/IR/PDLOps.td",
3348     deps = [":PDLDialectTdFiles"],
3351 gentbl_cc_library(
3352     name = "PDLTypesIncGen",
3353     strip_include_prefix = "include",
3354     tbl_outs = [
3355         (
3356             ["-gen-typedef-decls"],
3357             "include/mlir/Dialect/PDL/IR/PDLOpsTypes.h.inc",
3358         ),
3359         (
3360             ["-gen-typedef-defs"],
3361             "include/mlir/Dialect/PDL/IR/PDLOpsTypes.cpp.inc",
3362         ),
3363     ],
3364     tblgen = ":mlir-tblgen",
3365     td_file = "include/mlir/Dialect/PDL/IR/PDLTypes.td",
3366     deps = [":PDLDialectTdFiles"],
3369 cc_library(
3370     name = "PDLInterpDialect",
3371     srcs = glob([
3372         "lib/Dialect/PDLInterp/IR/*.cpp",
3373         "lib/Dialect/PDLInterp/IR/*.h",
3374     ]),
3375     hdrs = glob([
3376         "include/mlir/Dialect/PDLInterp/IR/*.h",
3377     ]),
3378     includes = ["include"],
3379     deps = [
3380         ":IR",
3381         ":InferTypeOpInterface",
3382         ":PDLDialect",
3383         ":PDLInterpOpsIncGen",
3384         ":SideEffects",
3385         ":Support",
3386         "//llvm:Support",
3387     ],
3390 td_library(
3391     name = "PDLInterpOpsTdFiles",
3392     srcs = ["include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td"],
3393     includes = ["include"],
3394     deps = [
3395         ":OpBaseTdFiles",
3396         ":PDLDialectTdFiles",
3397         ":SideEffectInterfacesTdFiles",
3398     ],
3401 gentbl_cc_library(
3402     name = "PDLInterpOpsIncGen",
3403     strip_include_prefix = "include",
3404     tbl_outs = [
3405         (
3406             ["-gen-op-decls"],
3407             "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.h.inc",
3408         ),
3409         (
3410             ["-gen-op-defs"],
3411             "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.cpp.inc",
3412         ),
3413         (
3414             [
3415                 "-gen-dialect-decls",
3416                 "-dialect=pdl_interp",
3417             ],
3418             "include/mlir/Dialect/PDLInterp/IR/PDLInterpOpsDialect.h.inc",
3419         ),
3420         (
3421             [
3422                 "-gen-dialect-defs",
3423                 "-dialect=pdl_interp",
3424             ],
3425             "include/mlir/Dialect/PDLInterp/IR/PDLInterpOpsDialect.cpp.inc",
3426         ),
3427     ],
3428     tblgen = ":mlir-tblgen",
3429     td_file = "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td",
3430     deps = [":PDLInterpOpsTdFiles"],
3433 td_library(
3434     name = "SPIRVOpsTdFiles",
3435     srcs = glob(["include/mlir/Dialect/SPIRV/IR/*.td"]),
3436     includes = ["include"],
3437     deps = [
3438         ":CallInterfacesTdFiles",
3439         ":ControlFlowInterfacesTdFiles",
3440         ":OpBaseTdFiles",
3441         ":SideEffectInterfacesTdFiles",
3442     ],
3445 gentbl_cc_library(
3446     name = "SPIRVOpsIncGen",
3447     strip_include_prefix = "include",
3448     tbl_outs = [
3449         (
3450             ["-gen-op-decls"],
3451             "include/mlir/Dialect/SPIRV/IR/SPIRVOps.h.inc",
3452         ),
3453         (
3454             ["-gen-op-defs"],
3455             "include/mlir/Dialect/SPIRV/IR/SPIRVOps.cpp.inc",
3456         ),
3457         (
3458             ["-gen-dialect-decls"],
3459             "include/mlir/Dialect/SPIRV/IR/SPIRVOpsDialect.h.inc",
3460         ),
3461         (
3462             ["-gen-dialect-defs"],
3463             "include/mlir/Dialect/SPIRV/IR/SPIRVOpsDialect.cpp.inc",
3464         ),
3465         (
3466             ["-gen-op-doc"],
3467             "g3doc/Dialects/SPIRV/SPIRVOps.md",
3468         ),
3469         (
3470             ["-gen-enum-decls"],
3471             "include/mlir/Dialect/SPIRV/IR/SPIRVEnums.h.inc",
3472         ),
3473         (
3474             ["-gen-enum-defs"],
3475             "include/mlir/Dialect/SPIRV/IR/SPIRVEnums.cpp.inc",
3476         ),
3477         (
3478             ["-gen-spirv-enum-avail-decls"],
3479             "include/mlir/Dialect/SPIRV/IR/SPIRVEnumAvailability.h.inc",
3480         ),
3481         (
3482             ["-gen-spirv-enum-avail-defs"],
3483             "include/mlir/Dialect/SPIRV/IR/SPIRVEnumAvailability.cpp.inc",
3484         ),
3485         (
3486             ["-gen-spirv-capability-implication"],
3487             "include/mlir/Dialect/SPIRV/IR/SPIRVCapabilityImplication.inc",
3488         ),
3489     ],
3490     tblgen = ":mlir-tblgen",
3491     td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVOps.td",
3492     deps = [":SPIRVOpsTdFiles"],
3495 gentbl_cc_library(
3496     name = "SPIRVCanonicalizationIncGen",
3497     strip_include_prefix = "lib/Dialect/SPIRV/IR",
3498     tbl_outs = [
3499         (
3500             ["-gen-rewriters"],
3501             "lib/Dialect/SPIRV/IR/SPIRVCanonicalization.inc",
3502         ),
3503     ],
3504     tblgen = ":mlir-tblgen",
3505     td_file = "lib/Dialect/SPIRV/IR/SPIRVCanonicalization.td",
3506     deps = [":SPIRVOpsTdFiles"],
3509 gentbl_cc_library(
3510     name = "SPIRVAvailabilityIncGen",
3511     strip_include_prefix = "include",
3512     tbl_outs = [
3513         (
3514             ["-gen-avail-interface-decls"],
3515             "include/mlir/Dialect/SPIRV/IR/SPIRVAvailability.h.inc",
3516         ),
3517         (
3518             ["-gen-avail-interface-defs"],
3519             "include/mlir/Dialect/SPIRV/IR/SPIRVAvailability.cpp.inc",
3520         ),
3521         (
3522             ["-gen-spirv-avail-impls"],
3523             "include/mlir/Dialect/SPIRV/IR/SPIRVOpAvailabilityImpl.inc",
3524         ),
3525     ],
3526     tblgen = ":mlir-tblgen",
3527     td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVOps.td",
3528     deps = [":SPIRVOpsTdFiles"],
3531 gentbl_cc_library(
3532     name = "SPIRVTargetAndABIStructGen",
3533     tbl_outs = [
3534         (
3535             ["-gen-struct-attr-decls"],
3536             "include/mlir/Dialect/SPIRV/IR/TargetAndABI.h.inc",
3537         ),
3538         (
3539             ["-gen-struct-attr-defs"],
3540             "include/mlir/Dialect/SPIRV/IR/TargetAndABI.cpp.inc",
3541         ),
3542     ],
3543     tblgen = ":mlir-tblgen",
3544     td_file = "include/mlir/Dialect/SPIRV/IR/TargetAndABI.td",
3545     deps = [":SPIRVOpsTdFiles"],
3548 gentbl_cc_library(
3549     name = "SPIRVAttrUtilsGen",
3550     strip_include_prefix = "include",
3551     tbl_outs = [
3552         (
3553             ["-gen-spirv-attr-utils"],
3554             "include/mlir/Dialect/SPIRV/IR/SPIRVAttrUtils.inc",
3555         ),
3556     ],
3557     tblgen = ":mlir-tblgen",
3558     td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVBase.td",
3559     deps = [":SPIRVOpsTdFiles"],
3562 gentbl_cc_library(
3563     name = "SPIRVSerializationGen",
3564     strip_include_prefix = "include",
3565     tbl_outs = [
3566         (
3567             ["-gen-spirv-serialization"],
3568             "include/mlir/Dialect/SPIRV/IR/SPIRVSerialization.inc",
3569         ),
3570     ],
3571     tblgen = ":mlir-tblgen",
3572     td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVOps.td",
3573     deps = [":SPIRVOpsTdFiles"],
3576 cc_library(
3577     name = "SPIRVDialect",
3578     srcs = glob([
3579         "lib/Dialect/SPIRV/IR/*.cpp",
3580         "lib/Dialect/SPIRV/IR/*.h",
3581     ]) + ["include/mlir/Transforms/InliningUtils.h"],
3582     hdrs = glob([
3583         "include/mlir/Dialect/SPIRV/IR/*.h",
3584     ]),
3585     includes = ["include"],
3586     deps = [
3587         ":CommonFolders",
3588         ":ControlFlowInterfaces",
3589         ":IR",
3590         ":Parser",
3591         ":Pass",
3592         ":SPIRVAttrUtilsGen",
3593         ":SPIRVAvailabilityIncGen",
3594         ":SPIRVCanonicalizationIncGen",
3595         ":SPIRVOpsIncGen",
3596         ":SPIRVSerializationGen",
3597         ":SPIRVTargetAndABIStructGen",
3598         ":SideEffectInterfaces",
3599         ":Support",
3600         ":Transforms",
3601         "//llvm:Support",
3602     ],
3605 gentbl_cc_library(
3606     name = "SPIRVPassIncGen",
3607     strip_include_prefix = "include",
3608     tbl_outs = [
3609         (
3610             [
3611                 "-gen-pass-decls",
3612                 "-name=SPIRV",
3613             ],
3614             "include/mlir/Dialect/SPIRV/Transforms/Passes.h.inc",
3615         ),
3616     ],
3617     tblgen = ":mlir-tblgen",
3618     td_file = "include/mlir/Dialect/SPIRV/Transforms/Passes.td",
3619     deps = [":PassBaseTdFiles"],
3622 cc_library(
3623     name = "SPIRVUtils",
3624     srcs = glob([
3625         "lib/Dialect/SPIRV/Utils/*.cpp",
3626     ]),
3627     hdrs = glob([
3628         "include/mlir/Dialect/SPIRV/Utils/*.h",
3629     ]),
3630     includes = ["include"],
3631     deps = [
3632         ":SPIRVDialect",
3633         ":Support",
3634         "//llvm:Support",
3635     ],
3638 cc_library(
3639     name = "SPIRVConversion",
3640     srcs = ["lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp"],
3641     hdrs = ["include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"],
3642     includes = ["include"],
3643     deps = [
3644         ":SPIRVDialect",
3645         ":Support",
3646         ":TransformUtils",
3647         "//llvm:Support",
3648     ],
3651 cc_library(
3652     name = "SPIRVTransforms",
3653     srcs = glob(
3654         [
3655             "lib/Dialect/SPIRV/Transforms/*.cpp",
3656             "lib/Dialect/SPIRV/Transforms/*.h",
3657         ],
3658         exclude = ["lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp"],
3659     ),
3660     hdrs = glob(
3661         ["include/mlir/Dialect/SPIRV/Transforms/*.h"],
3662         exclude = ["include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"],
3663     ),
3664     includes = ["include"],
3665     deps = [
3666         ":IR",
3667         ":Pass",
3668         ":SPIRVConversion",
3669         ":SPIRVDialect",
3670         ":SPIRVPassIncGen",
3671         ":SPIRVUtils",
3672         ":Support",
3673         ":Transforms",
3674         "//llvm:Support",
3675     ],
3678 cc_library(
3679     name = "MathToSPIRV",
3680     srcs = glob([
3681         "lib/Conversion/MathToSPIRV/*.cpp",
3682         "lib/Conversion/MathToSPIRV/*.h",
3683     ]) + ["lib/Conversion/PassDetail.h"],
3684     hdrs = glob([
3685         "include/mlir/Conversion/MathToSPIRV/*.h",
3686     ]),
3687     includes = [
3688         "include",
3689         "lib/Conversion/MathToSPIRV",
3690     ],
3691     deps = [
3692         ":ConversionPassIncGen",
3693         ":IR",
3694         ":MathDialect",
3695         ":Pass",
3696         ":SPIRVConversion",
3697         ":SPIRVDialect",
3698         ":Support",
3699         ":Transforms",
3700         "//llvm:Support",
3701     ],
3704 cc_library(
3705     name = "StandardToSPIRV",
3706     srcs = glob([
3707         "lib/Conversion/StandardToSPIRV/*.cpp",
3708         "lib/Conversion/StandardToSPIRV/*.h",
3709     ]) + ["lib/Conversion/PassDetail.h"],
3710     hdrs = glob([
3711         "include/mlir/Conversion/StandardToSPIRV/*.h",
3712     ]),
3713     includes = [
3714         "include",
3715         "lib/Conversion/StandardToSPIRV",
3716     ],
3717     deps = [
3718         ":ConversionPassIncGen",
3719         ":IR",
3720         ":Pass",
3721         ":SPIRVConversion",
3722         ":SPIRVDialect",
3723         ":SPIRVUtils",
3724         ":StandardOps",
3725         ":Support",
3726         ":TensorDialect",
3727         ":Transforms",
3728         ":VectorOps",
3729         "//llvm:Support",
3730     ],
3733 cc_library(
3734     name = "SPIRVBinaryUtils",
3735     srcs = ["lib/Target/SPIRV/SPIRVBinaryUtils.cpp"],
3736     hdrs = ["include/mlir/Target/SPIRV/SPIRVBinaryUtils.h"],
3737     includes = ["include"],
3738     deps = [
3739         ":IR",
3740         ":SPIRVAttrUtilsGen",
3741         ":SPIRVDialect",
3742         ":SPIRVOpsIncGen",
3743         ":Support",
3744         "//llvm:Support",
3745     ],
3748 cc_library(
3749     name = "SPIRVSerialization",
3750     srcs = [
3751         "lib/Target/SPIRV/Serialization/Serialization.cpp",
3752         "lib/Target/SPIRV/Serialization/SerializeOps.cpp",
3753         "lib/Target/SPIRV/Serialization/Serializer.cpp",
3754         "lib/Target/SPIRV/Serialization/Serializer.h",
3755     ],
3756     hdrs = ["include/mlir/Target/SPIRV/Serialization.h"],
3757     includes = ["include"],
3758     deps = [
3759         ":IR",
3760         ":SPIRVAttrUtilsGen",
3761         ":SPIRVBinaryUtils",
3762         ":SPIRVDialect",
3763         ":SPIRVOpsIncGen",
3764         ":SPIRVSerializationGen",
3765         ":Support",
3766         ":Transforms",
3767         "//llvm:Support",
3768     ],
3771 cc_library(
3772     name = "SPIRVDeserialization",
3773     srcs = glob([
3774         "lib/Target/SPIRV/Deserialization/*.cpp",
3775         "lib/Target/SPIRV/Deserialization/*.h",
3776     ]),
3777     hdrs = ["include/mlir/Target/SPIRV/Deserialization.h"],
3778     includes = ["include"],
3779     deps = [
3780         ":IR",
3781         ":SPIRVAttrUtilsGen",
3782         ":SPIRVBinaryUtils",
3783         ":SPIRVDialect",
3784         ":SPIRVOpsIncGen",
3785         ":SPIRVSerializationGen",
3786         ":Support",
3787         ":Transforms",
3788         "//llvm:Support",
3789     ],
3792 cc_library(
3793     name = "SPIRVModuleCombiner",
3794     srcs = glob(
3795         ["lib/Dialect/SPIRV/Linking/ModuleCombiner/*.cpp"],
3796     ),
3797     hdrs = ["include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h"],
3798     includes = ["include"],
3799     deps = [
3800         ":IR",
3801         ":SPIRVDialect",
3802         ":Support",
3803         "//llvm:Support",
3804     ],
3807 cc_library(
3808     name = "SPIRVTranslateRegistration",
3809     srcs = ["lib/Target/SPIRV/TranslateRegistration.cpp"],
3810     includes = ["include"],
3811     deps = [
3812         ":IR",
3813         ":Parser",
3814         ":SPIRVDeserialization",
3815         ":SPIRVDialect",
3816         ":SPIRVSerialization",
3817         ":Support",
3818         ":Translation",
3819         "//llvm:Support",
3820     ],
3823 td_library(
3824     name = "TensorOpsTdFiles",
3825     srcs = [
3826         "include/mlir/Dialect/Tensor/IR/TensorBase.td",
3827         "include/mlir/Dialect/Tensor/IR/TensorOps.td",
3828     ],
3829     includes = ["include"],
3830     deps = [
3831         ":CastInterfacesTdFiles",
3832         ":ControlFlowInterfacesTdFiles",
3833         ":InferTypeOpInterfaceTdFiles",
3834         ":OpBaseTdFiles",
3835         ":SideEffectInterfacesTdFiles",
3836         ":ViewLikeInterfaceTdFiles",
3837     ],
3840 gentbl_cc_library(
3841     name = "TensorOpsIncGen",
3842     strip_include_prefix = "include",
3843     tbl_outs = [
3844         (
3845             [
3846                 "-gen-dialect-decls",
3847                 "-dialect=tensor",
3848             ],
3849             "include/mlir/Dialect/Tensor/IR/TensorOpsDialect.h.inc",
3850         ),
3851         (
3852             [
3853                 "-gen-dialect-defs",
3854                 "-dialect=tensor",
3855             ],
3856             "include/mlir/Dialect/Tensor/IR/TensorOpsDialect.cpp.inc",
3857         ),
3858         (
3859             ["-gen-op-decls"],
3860             "include/mlir/Dialect/Tensor/IR/TensorOps.h.inc",
3861         ),
3862         (
3863             ["-gen-op-defs"],
3864             "include/mlir/Dialect/Tensor/IR/TensorOps.cpp.inc",
3865         ),
3866     ],
3867     tblgen = ":mlir-tblgen",
3868     td_file = "include/mlir/Dialect/Tensor/IR/TensorOps.td",
3869     deps = [":TensorOpsTdFiles"],
3872 cc_library(
3873     name = "TensorDialect",
3874     srcs = glob(
3875         [
3876             "lib/Dialect/Tensor/IR/*.cpp",
3877             "lib/Dialect/Tensor/IR/*.h",
3878         ],
3879     ) + ["include/mlir/Transforms/InliningUtils.h"],
3880     hdrs = ["include/mlir/Dialect/Tensor/IR/Tensor.h"],
3881     includes = ["include"],
3882     deps = [
3883         ":CastOpInterfaces",
3884         ":ControlFlowInterfaces",
3885         ":DialectUtils",
3886         ":IR",
3887         ":InferTypeOpInterface",
3888         ":SideEffectInterfaces",
3889         ":StandardOps",
3890         ":Support",
3891         ":TensorOpsIncGen",
3892         ":ViewLikeInterface",
3893         "//llvm:Support",
3894     ],
3897 gentbl_cc_library(
3898     name = "TensorPassIncGen",
3899     strip_include_prefix = "include",
3900     tbl_outs = [
3901         (
3902             [
3903                 "-gen-pass-decls",
3904                 "-name=Tensor",
3905             ],
3906             "include/mlir/Dialect/Tensor/Transforms/Passes.h.inc",
3907         ),
3908     ],
3909     tblgen = ":mlir-tblgen",
3910     td_file = "include/mlir/Dialect/Tensor/Transforms/Passes.td",
3911     deps = [":PassBaseTdFiles"],
3914 cc_library(
3915     name = "TensorTransforms",
3916     srcs = glob(
3917         [
3918             "lib/Dialect/Tensor/Transforms/*.cpp",
3919             "lib/Dialect/Tensor/Transforms/*.h",
3920         ],
3921     ),
3922     hdrs = ["include/mlir/Dialect/Tensor/Transforms/Passes.h"],
3923     includes = ["include"],
3924     deps = [
3925         ":Async",
3926         ":IR",
3927         ":MemRefDialect",
3928         ":ParallelLoopMapperAttrGen",
3929         ":Pass",
3930         ":SCFDialect",
3931         ":StandardOps",
3932         ":Support",
3933         ":TensorDialect",
3934         ":TensorPassIncGen",
3935         ":Transforms",
3936         "//llvm:Support",
3937     ],
3940 cc_library(
3941     name = "Rewrite",
3942     srcs = glob([
3943         "lib/Rewrite/*.cpp",
3944         "lib/Rewrite/*.h",
3945     ]),
3946     hdrs = glob(["include/mlir/Rewrite/*.h"]),
3947     includes = ["include"],
3948     deps = [
3949         ":Analysis",
3950         ":IR",
3951         ":PDLDialect",
3952         ":PDLInterpDialect",
3953         ":PDLToPDLInterp",
3954         ":Pass",
3955         ":SideEffectInterfaces",
3956         "//llvm:Support",
3957     ],
3960 cc_library(
3961     name = "TransformUtils",
3962     srcs = glob([
3963         "lib/Transforms/Utils/*.cpp",
3964         "lib/Transforms/Utils/*.h",
3965     ]),
3966     hdrs = glob([
3967         "include/mlir/Transforms/*.h",
3968     ]),
3969     includes = ["include"],
3970     deps = [
3971         ":Affine",
3972         ":Analysis",
3973         ":ControlFlowInterfaces",
3974         ":IR",
3975         ":MemRefDialect",
3976         ":Pass",
3977         ":Rewrite",
3978         ":SCFDialect",
3979         ":SideEffectInterfaces",
3980         ":StandardOps",
3981         ":Support",
3982         ":TransformsPassIncGen",
3983         "//llvm:Support",
3984     ],
3987 gentbl_cc_library(
3988     name = "DerivedAttributeOpInterfaceIncGen",
3989     strip_include_prefix = "include",
3990     tbl_outs = [
3991         (
3992             ["-gen-op-interface-decls"],
3993             "include/mlir/Interfaces/DerivedAttributeOpInterface.h.inc",
3994         ),
3995         (
3996             ["-gen-op-interface-defs"],
3997             "include/mlir/Interfaces/DerivedAttributeOpInterface.cpp.inc",
3998         ),
3999     ],
4000     tblgen = ":mlir-tblgen",
4001     td_file = "include/mlir/Interfaces/DerivedAttributeOpInterface.td",
4002     deps = [":DerivedAttributeOpInterfaceTdFiles"],
4005 cc_library(
4006     name = "DerivedAttributeOpInterface",
4007     srcs = ["lib/Interfaces/DerivedAttributeOpInterface.cpp"],
4008     hdrs = ["include/mlir/Interfaces/DerivedAttributeOpInterface.h"],
4009     includes = ["include"],
4010     deps = [
4011         ":DerivedAttributeOpInterfaceIncGen",
4012         ":IR",
4013         ":Support",
4014         "//llvm:Support",
4015     ],
4018 td_library(
4019     name = "DataLayoutInterfacesTdFiles",
4020     srcs = ["include/mlir/Interfaces/DataLayoutInterfaces.td"],
4021     includes = ["include"],
4024 gentbl_cc_library(
4025     name = "DataLayoutInterfacesIncGen",
4026     tbl_outs = [
4027         (
4028             ["-gen-attr-interface-decls"],
4029             "include/mlir/Interfaces/DataLayoutAttrInterface.h.inc",
4030         ),
4031         (
4032             ["-gen-attr-interface-defs"],
4033             "include/mlir/Interfaces/DataLayoutAttrInterface.cpp.inc",
4034         ),
4035         (
4036             ["-gen-op-interface-decls"],
4037             "include/mlir/Interfaces/DataLayoutOpInterface.h.inc",
4038         ),
4039         (
4040             ["-gen-op-interface-defs"],
4041             "include/mlir/Interfaces/DataLayoutOpInterface.cpp.inc",
4042         ),
4043         (
4044             ["-gen-type-interface-decls"],
4045             "include/mlir/Interfaces/DataLayoutTypeInterface.h.inc",
4046         ),
4047         (
4048             ["-gen-type-interface-defs"],
4049             "include/mlir/Interfaces/DataLayoutTypeInterface.cpp.inc",
4050         ),
4051     ],
4052     tblgen = ":mlir-tblgen",
4053     td_file = "include/mlir/Interfaces/DataLayoutInterfaces.td",
4054     deps = [":OpBaseTdFiles"],
4057 gentbl_cc_library(
4058     name = "LoopLikeInterfaceIncGen",
4059     strip_include_prefix = "include",
4060     tbl_outs = [
4061         (
4062             ["-gen-op-interface-decls"],
4063             "include/mlir/Interfaces/LoopLikeInterface.h.inc",
4064         ),
4065         (
4066             ["-gen-op-interface-defs"],
4067             "include/mlir/Interfaces/LoopLikeInterface.cpp.inc",
4068         ),
4069     ],
4070     tblgen = ":mlir-tblgen",
4071     td_file = "include/mlir/Interfaces/LoopLikeInterface.td",
4072     deps = [":LoopLikeInterfaceTdFiles"],
4075 gentbl_cc_library(
4076     name = "VectorInterfacesIncGen",
4077     strip_include_prefix = "include",
4078     tbl_outs = [
4079         (
4080             ["-gen-op-interface-decls"],
4081             "include/mlir/Interfaces/VectorInterfaces.h.inc",
4082         ),
4083         (
4084             ["-gen-op-interface-defs"],
4085             "include/mlir/Interfaces/VectorInterfaces.cpp.inc",
4086         ),
4087     ],
4088     tblgen = ":mlir-tblgen",
4089     td_file = "include/mlir/Interfaces/VectorInterfaces.td",
4090     deps = [":VectorInterfacesTdFiles"],
4093 gentbl_cc_library(
4094     name = "ViewLikeInterfaceIncGen",
4095     strip_include_prefix = "include",
4096     tbl_outs = [
4097         (
4098             ["-gen-op-interface-decls"],
4099             "include/mlir/Interfaces/ViewLikeInterface.h.inc",
4100         ),
4101         (
4102             ["-gen-op-interface-defs"],
4103             "include/mlir/Interfaces/ViewLikeInterface.cpp.inc",
4104         ),
4105     ],
4106     tblgen = ":mlir-tblgen",
4107     td_file = "include/mlir/Interfaces/ViewLikeInterface.td",
4108     deps = [":ViewLikeInterfaceTdFiles"],
4111 gentbl_cc_library(
4112     name = "CopyOpInterfaceIncGen",
4113     strip_include_prefix = "include",
4114     tbl_outs = [
4115         (
4116             ["-gen-op-interface-decls"],
4117             "include/mlir/Interfaces/CopyOpInterface.h.inc",
4118         ),
4119         (
4120             ["-gen-op-interface-defs"],
4121             "include/mlir/Interfaces/CopyOpInterface.cpp.inc",
4122         ),
4123     ],
4124     tblgen = ":mlir-tblgen",
4125     td_file = "include/mlir/Interfaces/CopyOpInterface.td",
4126     deps = [":CopyOpInterfaceTdFiles"],
4129 gentbl_cc_library(
4130     name = "TransformsPassIncGen",
4131     strip_include_prefix = "include",
4132     tbl_outs = [
4133         (
4134             [
4135                 "-gen-pass-decls",
4136                 "-name=Transforms",
4137             ],
4138             "include/mlir/Transforms/Passes.h.inc",
4139         ),
4140         (
4141             [
4142                 "-gen-pass-capi-header",
4143                 "--prefix=Transforms",
4144             ],
4145             "include/mlir/Transforms/Transforms.capi.h.inc",
4146         ),
4147         (
4148             [
4149                 "-gen-pass-capi-impl",
4150                 "--prefix=Transforms",
4151             ],
4152             "include/mlir/Transforms/Transforms.capi.cpp.inc",
4153         ),
4154     ],
4155     tblgen = ":mlir-tblgen",
4156     td_file = "include/mlir/Transforms/Passes.td",
4157     deps = [
4158         ":PassBaseTdFiles",
4159         ":RewritePassBaseTdFiles",
4160     ],
4163 cc_library(
4164     name = "Transforms",
4165     srcs = glob([
4166         "lib/Transforms/*.cpp",
4167         "lib/Transforms/*.h",
4168     ]),
4169     hdrs = glob(["include/mlir/Transforms/*.h"]),
4170     includes = ["include"],
4171     deps = [
4172         ":Affine",
4173         ":Analysis",
4174         ":ControlFlowInterfaces",
4175         ":CopyOpInterface",
4176         ":IR",
4177         ":LinalgOps",
4178         ":LoopLikeInterface",
4179         ":MemRefDialect",
4180         ":Pass",
4181         ":Rewrite",
4182         ":SCFDialect",
4183         ":SideEffectInterfaces",
4184         ":StandardOps",
4185         ":Support",
4186         ":TensorDialect",
4187         ":TransformUtils",
4188         ":TransformsPassIncGen",
4189         "//llvm:Support",
4190     ],
4193 cc_library(
4194     name = "CommonFolders",
4195     srcs = [
4196     ],
4197     hdrs = ["include/mlir/Dialect/CommonFolders.h"],
4198     includes = ["include"],
4199     deps = [
4200         ":IR",
4201         "//llvm:Support",
4202     ],
4205 cc_library(
4206     name = "SCFToGPU",
4207     srcs = ["lib/Conversion/SCFToGPU/SCFToGPU.cpp"],
4208     hdrs = ["include/mlir/Conversion/SCFToGPU/SCFToGPU.h"],
4209     includes = ["include"],
4210     deps = [
4211         ":Affine",
4212         ":AffineToStandard",
4213         ":ConversionPassIncGen",
4214         ":GPUDialect",
4215         ":GPUTransforms",
4216         ":IR",
4217         ":MemRefDialect",
4218         ":Pass",
4219         ":SCFDialect",
4220         ":StandardOps",
4221         ":Support",
4222         ":TransformUtils",
4223         ":Transforms",
4224         "//llvm:Support",
4225     ],
4228 cc_library(
4229     name = "SCFToGPUPass",
4230     srcs = [
4231         "lib/Conversion/PassDetail.h",
4232         "lib/Conversion/SCFToGPU/SCFToGPUPass.cpp",
4233     ],
4234     hdrs = ["include/mlir/Conversion/SCFToGPU/SCFToGPUPass.h"],
4235     includes = ["include"],
4236     deps = [
4237         ":Affine",
4238         ":ComplexDialect",
4239         ":ConversionPassIncGen",
4240         ":GPUDialect",
4241         ":Pass",
4242         ":SCFDialect",
4243         ":SCFToGPU",
4244         ":StandardOps",
4245         ":Support",
4246         ":Transforms",
4247         "//llvm:Support",
4248     ],
4251 cc_library(
4252     name = "SCFToSPIRV",
4253     srcs = glob([
4254         "lib/Conversion/SCFToSPIRV/*.cpp",
4255         "lib/Conversion/SCFToSPIRV/*.h",
4256     ]) + ["lib/Conversion/PassDetail.h"],
4257     hdrs = glob([
4258         "include/mlir/Conversion/SCFToSPIRV/*.h",
4259     ]),
4260     includes = ["include"],
4261     deps = [
4262         ":Affine",
4263         ":ConversionPassIncGen",
4264         ":IR",
4265         ":MemRefToSPIRV",
4266         ":Pass",
4267         ":SCFDialect",
4268         ":SPIRVConversion",
4269         ":SPIRVDialect",
4270         ":StandardOps",
4271         ":StandardToSPIRV",
4272         ":Support",
4273         ":TransformUtils",
4274         ":Transforms",
4275         "//llvm:Support",
4276     ],
4279 cc_library(
4280     name = "SCFToOpenMP",
4281     srcs = [
4282         "lib/Conversion/PassDetail.h",
4283         "lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp",
4284     ],
4285     hdrs = ["include/mlir/Conversion/SCFToOpenMP/SCFToOpenMP.h"],
4286     includes = ["include"],
4287     deps = [
4288         ":ConversionPassIncGen",
4289         ":IR",
4290         ":OpenMPDialect",
4291         ":Pass",
4292         ":SCFDialect",
4293         ":Support",
4294         ":Transforms",
4295     ],
4298 cc_library(
4299     name = "SCFToStandard",
4300     srcs = [
4301         "lib/Conversion/PassDetail.h",
4302         "lib/Conversion/SCFToStandard/SCFToStandard.cpp",
4303     ],
4304     hdrs = ["include/mlir/Conversion/SCFToStandard/SCFToStandard.h"],
4305     includes = ["include"],
4306     deps = [
4307         ":ConversionPassIncGen",
4308         ":IR",
4309         ":LLVMDialect",
4310         ":Pass",
4311         ":SCFDialect",
4312         ":StandardOps",
4313         ":Support",
4314         ":TransformUtils",
4315         ":Transforms",
4316     ],
4319 alias(
4320     name = "CFGTransforms",
4321     actual = "SCFToStandard",
4324 cc_library(
4325     name = "LLVMCommonConversion",
4326     srcs = glob([
4327         "lib/Conversion/LLVMCommon/*.cpp",
4328     ]) + ["lib/Conversion/LLVMCommon/MemRefDescriptor.h"],
4329     hdrs = glob(["include/mlir/Conversion/LLVMCommon/*.h"]),
4330     includes = ["include"],
4331     deps = [
4332         ":IR",
4333         ":LLVMDialect",
4334         ":Support",
4335         ":Transforms",
4336         "//llvm:Core",
4337     ],
4340 cc_library(
4341     name = "StandardToLLVM",
4342     srcs = [
4343         "lib/Conversion/PassDetail.h",
4344         "lib/Conversion/StandardToLLVM/StandardToLLVM.cpp",
4345     ],
4346     hdrs = [
4347         "include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h",
4348         "include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h",
4349     ],
4350     includes = ["include"],
4351     deps = [
4352         ":Analysis",
4353         ":ConversionPassIncGen",
4354         ":DataLayoutInterfaces",
4355         ":DialectUtils",
4356         ":IR",
4357         ":LLVMCommonConversion",
4358         ":LLVMDialect",
4359         ":MathDialect",
4360         ":MemRefDialect",
4361         ":Parser",
4362         ":Pass",
4363         ":StandardOps",
4364         ":StandardOpsTransforms",
4365         ":Support",
4366         ":TransformUtils",
4367         ":Transforms",
4368         "//llvm:Core",
4369         "//llvm:Support",
4370     ],
4373 cc_library(
4374     name = "MemRefToLLVM",
4375     srcs = glob(["lib/Conversion/MemRefToLLVM/*.cpp"]) + ["lib/Conversion/PassDetail.h"],
4376     hdrs = glob(["include/mlir/Conversion/MemRefToLLVM/*.h"]),
4377     includes = ["include"],
4378     deps = [
4379         ":Analysis",
4380         ":ConversionPassIncGen",
4381         ":DataLayoutInterfaces",
4382         ":IR",
4383         ":LLVMCommonConversion",
4384         ":LLVMDialect",
4385         ":MemRefDialect",
4386         ":Pass",
4387         ":Support",
4388         ":Transforms",
4389     ],
4392 cc_library(
4393     name = "MemRefToSPIRV",
4394     srcs = glob([
4395         "lib/Conversion/MemRefToSPIRV/*.cpp",
4396         "lib/Conversion/MemRefToSPIRV/*.h",
4397     ]) + ["lib/Conversion/PassDetail.h"],
4398     hdrs = glob([
4399         "include/mlir/Conversion/MemRefToSPIRV/*.h",
4400     ]),
4401     includes = [
4402         "include",
4403         "lib/Conversion/MemRefToSPIRV",
4404     ],
4405     deps = [
4406         ":ConversionPassIncGen",
4407         ":IR",
4408         ":MemRefDialect",
4409         ":Pass",
4410         ":SPIRVConversion",
4411         ":SPIRVDialect",
4412         ":Support",
4413         ":Transforms",
4414         "//llvm:Support",
4415     ],
4418 cc_library(
4419     name = "MathToLLVM",
4420     srcs = glob(["lib/Conversion/MathToLLVM/*.cpp"]) + ["lib/Conversion/PassDetail.h"],
4421     hdrs = glob(["include/mlir/Conversion/MathToLLVM/*.h"]),
4422     includes = ["include"],
4423     deps = [
4424         ":Analysis",
4425         ":ConversionPassIncGen",
4426         ":DataLayoutInterfaces",
4427         ":IR",
4428         ":LLVMCommonConversion",
4429         ":LLVMDialect",
4430         ":MathDialect",
4431         ":Pass",
4432         ":Support",
4433         ":Transforms",
4434     ],
4437 alias(
4438     name = "LLVMTransforms",
4439     actual = "StandardToLLVM",
4442 gentbl_cc_library(
4443     name = "CallOpInterfacesIncGen",
4444     strip_include_prefix = "include",
4445     tbl_outs = [
4446         (
4447             ["-gen-op-interface-decls"],
4448             "include/mlir/Interfaces/CallInterfaces.h.inc",
4449         ),
4450         (
4451             ["-gen-op-interface-defs"],
4452             "include/mlir/Interfaces/CallInterfaces.cpp.inc",
4453         ),
4454     ],
4455     tblgen = ":mlir-tblgen",
4456     td_file = "include/mlir/Interfaces/CallInterfaces.td",
4457     deps = [":CallInterfacesTdFiles"],
4460 cc_library(
4461     name = "CallOpInterfaces",
4462     srcs = ["lib/Interfaces/CallInterfaces.cpp"],
4463     hdrs = ["include/mlir/Interfaces/CallInterfaces.h"],
4464     includes = ["include"],
4465     deps = [
4466         ":CallOpInterfacesIncGen",
4467         ":IR",
4468         ":Support",
4469         "//llvm:Support",
4470     ],
4473 gentbl_cc_library(
4474     name = "CastOpInterfacesIncGen",
4475     strip_include_prefix = "include",
4476     tbl_outs = [
4477         (
4478             ["-gen-op-interface-decls"],
4479             "include/mlir/Interfaces/CastInterfaces.h.inc",
4480         ),
4481         (
4482             ["-gen-op-interface-defs"],
4483             "include/mlir/Interfaces/CastInterfaces.cpp.inc",
4484         ),
4485     ],
4486     tblgen = ":mlir-tblgen",
4487     td_file = "include/mlir/Interfaces/CastInterfaces.td",
4488     deps = [":CastInterfacesTdFiles"],
4491 cc_library(
4492     name = "CastOpInterfaces",
4493     srcs = ["lib/Interfaces/CastInterfaces.cpp"],
4494     hdrs = ["include/mlir/Interfaces/CastInterfaces.h"],
4495     includes = ["include"],
4496     deps = [
4497         ":CastOpInterfacesIncGen",
4498         ":IR",
4499         ":Support",
4500         "//llvm:Support",
4501     ],
4504 gentbl_cc_library(
4505     name = "ControlFlowInterfacesIncGen",
4506     strip_include_prefix = "include",
4507     tbl_outs = [
4508         (
4509             ["-gen-op-interface-decls"],
4510             "include/mlir/Interfaces/ControlFlowInterfaces.h.inc",
4511         ),
4512         (
4513             ["-gen-op-interface-defs"],
4514             "include/mlir/Interfaces/ControlFlowInterfaces.cpp.inc",
4515         ),
4516     ],
4517     tblgen = ":mlir-tblgen",
4518     td_file = "include/mlir/Interfaces/ControlFlowInterfaces.td",
4519     deps = [":ControlFlowInterfacesTdFiles"],
4522 cc_library(
4523     name = "ControlFlowInterfaces",
4524     srcs = ["lib/Interfaces/ControlFlowInterfaces.cpp"],
4525     hdrs = ["include/mlir/Interfaces/ControlFlowInterfaces.h"],
4526     includes = ["include"],
4527     deps = [
4528         ":ControlFlowInterfacesIncGen",
4529         ":IR",
4530         ":Support",
4531         "//llvm:Support",
4532     ],
4535 gentbl_cc_library(
4536     name = "InferTypeOpInterfaceIncGen",
4537     strip_include_prefix = "include",
4538     tbl_outs = [
4539         (
4540             ["-gen-op-interface-decls"],
4541             "include/mlir/Interfaces/InferTypeOpInterface.h.inc",
4542         ),
4543         (
4544             ["-gen-op-interface-defs"],
4545             "include/mlir/Interfaces/InferTypeOpInterface.cpp.inc",
4546         ),
4547     ],
4548     tblgen = ":mlir-tblgen",
4549     td_file = "include/mlir/Interfaces/InferTypeOpInterface.td",
4550     deps = [":InferTypeOpInterfaceTdFiles"],
4553 cc_library(
4554     name = "InferTypeOpInterface",
4555     srcs = ["lib/Interfaces/InferTypeOpInterface.cpp"],
4556     hdrs = ["include/mlir/Interfaces/InferTypeOpInterface.h"],
4557     includes = ["include"],
4558     deps = [
4559         ":IR",
4560         ":InferTypeOpInterfaceIncGen",
4561         ":Support",
4562         "//llvm:Support",
4563     ],
4566 gentbl_cc_library(
4567     name = "SideEffectInterfacesIncGen",
4568     strip_include_prefix = "include",
4569     tbl_outs = [
4570         (
4571             ["-gen-op-interface-decls"],
4572             "include/mlir/Interfaces/SideEffectInterfaces.h.inc",
4573         ),
4574         (
4575             ["-gen-op-interface-defs"],
4576             "include/mlir/Interfaces/SideEffectInterfaces.cpp.inc",
4577         ),
4578     ],
4579     tblgen = ":mlir-tblgen",
4580     td_file = "include/mlir/Interfaces/SideEffectInterfaces.td",
4581     deps = [":SideEffectInterfacesTdFiles"],
4584 cc_library(
4585     name = "SideEffectInterfaces",
4586     srcs = ["lib/Interfaces/SideEffectInterfaces.cpp"],
4587     hdrs = ["include/mlir/Interfaces/SideEffectInterfaces.h"],
4588     includes = ["include"],
4589     deps = [
4590         ":IR",
4591         ":SideEffectInterfacesIncGen",
4592         ":Support",
4593         "//llvm:Support",
4594     ],
4597 alias(
4598     name = "SideEffects",
4599     actual = "SideEffectInterfaces",
4602 cc_library(
4603     name = "Analysis",
4604     srcs = glob(
4605         [
4606             "lib/Analysis/*.cpp",
4607             "lib/Analysis/*.h",
4608             "lib/Analysis/*/*.cpp",
4609             "lib/Analysis/*/*.h",
4610         ],
4611         exclude = [
4612             "lib/Analysis/Vector*.cpp",
4613             "lib/Analysis/Vector*.h",
4614         ],
4615     ),
4616     hdrs = glob(
4617         [
4618             "include/mlir/Analysis/*.h",
4619             "include/mlir/Analysis/*/*.h",
4620         ],
4621         exclude = ["include/mlir/Analysis/Vector*.h"],
4622     ),
4623     includes = ["include"],
4624     deps = [
4625         ":Affine",
4626         ":CallOpInterfaces",
4627         ":ControlFlowInterfaces",
4628         ":DataLayoutInterfaces",
4629         ":IR",
4630         ":LinalgOps",
4631         ":SCFDialect",
4632         ":SideEffectInterfaces",
4633         ":StandardOps",
4634         ":Support",
4635         ":ViewLikeInterface",
4636         "//llvm:Support",
4637     ],
4640 cc_library(
4641     name = "Translation",
4642     srcs = glob([
4643         "lib/Translation/*.cpp",
4644         "lib/Translation/*.h",
4645     ]),
4646     hdrs = ["include/mlir/Translation.h"],
4647     includes = ["include"],
4648     deps = [
4649         ":Analysis",
4650         ":IR",
4651         ":Parser",
4652         ":Support",
4653         "//llvm:Support",
4654     ],
4657 cc_library(
4658     name = "ToLLVMIRTranslation",
4659     srcs = [
4660         "lib/Target/LLVMIR/DebugTranslation.cpp",
4661         "lib/Target/LLVMIR/DebugTranslation.h",
4662         "lib/Target/LLVMIR/ModuleTranslation.cpp",
4663         "lib/Target/LLVMIR/TypeToLLVM.cpp",
4664     ],
4665     hdrs = [
4666         "include/mlir/Target/LLVMIR/Export.h",
4667         "include/mlir/Target/LLVMIR/LLVMTranslationInterface.h",
4668         "include/mlir/Target/LLVMIR/ModuleTranslation.h",
4669         "include/mlir/Target/LLVMIR/TypeToLLVM.h",
4670     ],
4671     includes = ["include"],
4672     deps = [
4673         ":IR",
4674         ":LLVMConversionIncGen",
4675         ":LLVMDialect",
4676         ":LLVMIRTransforms",
4677         ":OpenMPDialect",
4678         ":Support",
4679         "//llvm:Core",
4680         "//llvm:FrontendOpenMP",
4681         "//llvm:Support",
4682         "//llvm:TransformUtils",
4683     ],
4686 cc_library(
4687     name = "AMXToLLVMIRTranslation",
4688     srcs = glob(["lib/Target/LLVMIR/Dialect/AMX/*.cpp"]),
4689     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/AMX/*.h"]),
4690     includes = ["include"],
4691     deps = [
4692         ":AMX",
4693         ":AMXConversionIncGen",
4694         ":IR",
4695         ":Support",
4696         ":ToLLVMIRTranslation",
4697         "//llvm:Core",
4698         "//llvm:Support",
4699     ],
4702 cc_library(
4703     name = "X86VectorToLLVMIRTranslation",
4704     srcs = glob(["lib/Target/LLVMIR/Dialect/X86Vector/*.cpp"]),
4705     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/X86Vector/*.h"]),
4706     includes = ["include"],
4707     deps = [
4708         ":IR",
4709         ":Support",
4710         ":ToLLVMIRTranslation",
4711         ":X86Vector",
4712         ":X86VectorConversionIncGen",
4713         "//llvm:Core",
4714         "//llvm:Support",
4715     ],
4718 cc_library(
4719     name = "ArmNeonToLLVMIRTranslation",
4720     srcs = glob(["lib/Target/LLVMIR/Dialect/ArmNeon/*.cpp"]),
4721     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ArmNeon/*.h"]),
4722     includes = ["include"],
4723     deps = [
4724         ":ArmNeon",
4725         ":ArmNeonConversionIncGen",
4726         ":ArmNeonIncGen",
4727         ":IR",
4728         ":Support",
4729         ":ToLLVMIRTranslation",
4730         "//llvm:Core",
4731         "//llvm:Support",
4732     ],
4735 cc_library(
4736     name = "ArmSVEToLLVMIRTranslation",
4737     srcs = glob(["lib/Target/LLVMIR/Dialect/ArmSVE/*.cpp"]),
4738     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ArmSVE/*.h"]),
4739     includes = ["include"],
4740     deps = [
4741         ":ArmSVE",
4742         ":ArmSVEConversionIncGen",
4743         ":IR",
4744         ":Support",
4745         ":ToLLVMIRTranslation",
4746         "//llvm:Core",
4747         "//llvm:Support",
4748     ],
4751 cc_library(
4752     name = "NVVMToLLVMIRTranslation",
4753     srcs = glob(["lib/Target/LLVMIR/Dialect/NVVM/*.cpp"]),
4754     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/NVVM/*.h"]),
4755     includes = ["include"],
4756     deps = [
4757         ":IR",
4758         ":NVVMConversionIncGen",
4759         ":NVVMDialect",
4760         ":Support",
4761         ":ToLLVMIRTranslation",
4762         "//llvm:Core",
4763         "//llvm:Support",
4764     ],
4767 cc_library(
4768     name = "ROCDLToLLVMIRTranslation",
4769     srcs = glob(["lib/Target/LLVMIR/Dialect/ROCDL/*.cpp"]),
4770     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ROCDL/*.h"]),
4771     includes = ["include"],
4772     deps = [
4773         ":IR",
4774         ":ROCDLConversionIncGen",
4775         ":ROCDLDialect",
4776         ":Support",
4777         ":ToLLVMIRTranslation",
4778         "//llvm:Core",
4779         "//llvm:Support",
4780     ],
4783 cc_library(
4784     name = "LLVMToLLVMIRTranslation",
4785     srcs = glob(["lib/Target/LLVMIR/Dialect/LLVMIR/*.cpp"]),
4786     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/LLVMIR/*.h"]),
4787     includes = ["include"],
4788     deps = [
4789         ":IR",
4790         ":LLVMConversionIncGen",
4791         ":LLVMDialect",
4792         ":Support",
4793         ":ToLLVMIRTranslation",
4794         "//llvm:Core",
4795         "//llvm:Support",
4796     ],
4799 cc_library(
4800     name = "OpenACCToLLVMIRTranslation",
4801     srcs = glob(["lib/Target/LLVMIR/Dialect/OpenACC/*.cpp"]),
4802     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/OpenACC/*.h"]),
4803     includes = ["include"],
4804     deps = [
4805         ":IR",
4806         ":LLVMDialect",
4807         ":OpenACCDialect",
4808         ":OpenACCToLLVM",
4809         ":Support",
4810         ":ToLLVMIRTranslation",
4811         "//llvm:Core",
4812         "//llvm:FrontendOpenMP",
4813         "//llvm:Support",
4814     ],
4817 cc_library(
4818     name = "OpenMPToLLVMIRTranslation",
4819     srcs = glob(["lib/Target/LLVMIR/Dialect/OpenMP/*.cpp"]),
4820     hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/OpenMP/*.h"]),
4821     includes = ["include"],
4822     deps = [
4823         ":IR",
4824         ":OpenMPDialect",
4825         ":Support",
4826         ":ToLLVMIRTranslation",
4827         "//llvm:Core",
4828         "//llvm:FrontendOpenMP",
4829         "//llvm:Support",
4830     ],
4833 cc_library(
4834     name = "AllToLLVMIRTranslations",
4835     hdrs = ["include/mlir/Target/LLVMIR/Dialect/All.h"],
4836     includes = ["include"],
4837     deps = [
4838         ":AMXToLLVMIRTranslation",
4839         ":ArmNeonToLLVMIRTranslation",
4840         ":ArmSVEToLLVMIRTranslation",
4841         ":LLVMToLLVMIRTranslation",
4842         ":NVVMToLLVMIRTranslation",
4843         ":OpenACCToLLVMIRTranslation",
4844         ":OpenMPToLLVMIRTranslation",
4845         ":ROCDLToLLVMIRTranslation",
4846         ":X86VectorToLLVMIRTranslation",
4847     ],
4850 cc_library(
4851     name = "ToLLVMIRTranslationRegistration",
4852     srcs = ["lib/Target/LLVMIR/ConvertToLLVMIR.cpp"],
4853     includes = ["include"],
4854     deps = [
4855         ":AllToLLVMIRTranslations",
4856         ":IR",
4857         ":ToLLVMIRTranslation",
4858         ":Translation",
4859         "//llvm:Core",
4860         "//llvm:Support",
4861     ],
4864 cc_library(
4865     name = "FromLLVMIRTranslation",
4866     srcs = [
4867         "lib/Target/LLVMIR/ConvertFromLLVMIR.cpp",
4868         "lib/Target/LLVMIR/TypeFromLLVM.cpp",
4869     ],
4870     hdrs = [
4871         "include/mlir/Target/LLVMIR/Import.h",
4872         "include/mlir/Target/LLVMIR/TypeFromLLVM.h",
4873     ],
4874     includes = ["include"],
4875     deps = [
4876         ":IR",
4877         ":LLVMConversionIncGen",
4878         ":LLVMDialect",
4879         ":Support",
4880         ":Translation",
4881         "//llvm:Core",
4882         "//llvm:IRReader",
4883         "//llvm:Support",
4884     ],
4887 cc_library(
4888     name = "ExecutionEngine",
4889     srcs = [
4890         "include/mlir/ExecutionEngine/CRunnerUtils.h",
4891         "lib/ExecutionEngine/ExecutionEngine.cpp",
4892     ],
4893     hdrs = [
4894         "include/mlir/ExecutionEngine/ExecutionEngine.h",
4895         "include/mlir/ExecutionEngine/MemRefUtils.h",
4896     ],
4897     includes = ["include"],
4898     deps = [
4899         ":AllToLLVMIRTranslations",
4900         ":IR",
4901         ":LLVMDialect",
4902         ":Support",
4903         ":ToLLVMIRTranslation",
4904         ":Translation",
4905         "//llvm:BitReader",
4906         "//llvm:BitWriter",
4907         "//llvm:Core",
4908         "//llvm:ExecutionEngine",
4909         "//llvm:MC",
4910         "//llvm:OrcJIT",
4911         "//llvm:Support",
4912         "//llvm:Target",  # fixdeps: keep
4913         "//llvm:TransformUtils",
4914         "//llvm:X86CodeGen",  # fixdeps: keep
4915         "//llvm:X86Disassembler",  # fixdeps: keep
4916     ],
4919 cc_library(
4920     name = "ExecutionEngineUtils",
4921     srcs = ["lib/ExecutionEngine/OptUtils.cpp"],
4922     hdrs = ["include/mlir/ExecutionEngine/OptUtils.h"],
4923     includes = ["include"],
4924     deps = [
4925         "//llvm:Analysis",
4926         "//llvm:Core",
4927         "//llvm:Coroutines",
4928         "//llvm:IPO",
4929         "//llvm:Support",
4930         "//llvm:Target",
4931         "//llvm:common_transforms",
4932     ],
4935 # TODO(jpienaar): Update this.
4936 cc_library(
4937     name = "MlirOptLib",
4938     srcs = ["lib/Support/MlirOptMain.cpp"],
4939     hdrs = ["include/mlir/Support/MlirOptMain.h"],
4940     includes = ["include"],
4941     deps = [
4942         ":Analysis",
4943         ":ConversionPasses",
4944         ":GPUToGPURuntimeTransforms",
4945         ":GPUToNVVMTransforms",
4946         ":GPUToROCDLTransforms",
4947         ":GPUToSPIRV",
4948         ":GPUTransforms",
4949         ":IR",
4950         ":Parser",
4951         ":Pass",
4952         ":SCFTransforms",
4953         ":ShapeToStandard",
4954         ":ShapeTransforms",
4955         ":StandardOpsTransforms",
4956         ":StandardToLLVM",
4957         ":StandardToSPIRV",
4958         ":Support",
4959         "//llvm:Support",
4960     ],
4963 cc_library(
4964     name = "AllTranslations",
4965     hdrs = ["include/mlir/InitAllTranslations.h"],
4966     deps = [
4967         ":FromLLVMIRTranslation",
4968         ":SPIRVTranslateRegistration",
4969         ":ToLLVMIRTranslationRegistration",
4970     ],
4973 cc_library(
4974     name = "MlirTranslateMain",
4975     srcs = ["tools/mlir-translate/mlir-translate.cpp"],
4976     deps = [
4977         ":AllPassesAndDialects",
4978         ":AllTranslations",
4979         ":IR",
4980         ":Parser",
4981         ":Support",
4982         ":Translation",
4983         "//llvm:Support",
4984     ],
4987 cc_binary(
4988     name = "mlir-translate",
4989     deps = [":MlirTranslateMain"],
4992 cc_library(
4993     name = "AllPassesAndDialects",
4994     hdrs = [
4995         "include/mlir/InitAllDialects.h",
4996         "include/mlir/InitAllPasses.h",
4997     ],
4998     deps = [
4999         ":AMX",
5000         ":AMXTransforms",
5001         ":Affine",
5002         ":AffinePassIncGen",
5003         ":AffineToStandard",
5004         ":AffineTransforms",
5005         ":ArmNeon",
5006         ":ArmSVE",
5007         ":ArmSVETransforms",
5008         ":Async",
5009         ":AsyncPassIncGen",
5010         ":AsyncToLLVM",
5011         ":AsyncTransforms",
5012         ":ComplexDialect",
5013         ":ComplexToLLVM",
5014         ":ConversionPasses",
5015         ":DLTIDialect",
5016         ":EmitC",
5017         ":GPUDialect",
5018         ":GPUPassIncGen",
5019         ":GPUToGPURuntimeTransforms",
5020         ":GPUToNVVMTransforms",
5021         ":GPUToROCDLTransforms",
5022         ":GPUToSPIRV",
5023         ":GPUToVulkanTransforms",
5024         ":GPUTransforms",
5025         ":IR",
5026         ":LLVMDialect",
5027         ":LLVMIRTransforms",
5028         ":LLVMPassIncGen",
5029         ":LinalgOps",
5030         ":LinalgPassIncGen",
5031         ":LinalgToLLVM",
5032         ":LinalgToSPIRV",
5033         ":LinalgToStandard",
5034         ":LinalgTransforms",
5035         ":MathDialect",
5036         ":MathToLLVM",
5037         ":MathToLibm",
5038         ":MathToSPIRV",
5039         ":MathTransforms",
5040         ":MemRefDialect",
5041         ":MemRefToLLVM",
5042         ":MemRefToSPIRV",
5043         ":MemRefTransforms",
5044         ":NVVMDialect",
5045         ":OpenACCDialect",
5046         ":OpenMPDialect",
5047         ":OpenMPToLLVM",
5048         ":PDLDialect",
5049         ":PDLInterpDialect",
5050         ":PDLToPDLInterp",
5051         ":QuantOps",
5052         ":QuantPassIncGen",
5053         ":ROCDLDialect",
5054         ":SCFDialect",
5055         ":SCFPassIncGen",
5056         ":SCFToGPUPass",
5057         ":SCFToStandard",
5058         ":SCFTransforms",
5059         ":SDBM",
5060         ":SPIRVDialect",
5061         ":SPIRVPassIncGen",
5062         ":SPIRVToLLVM",
5063         ":SPIRVTransforms",
5064         ":Shape",
5065         ":ShapeToStandard",
5066         ":ShapeTransforms",
5067         ":ShapeTransformsPassIncGen",
5068         ":SparseTensor",
5069         ":SparseTensorTransforms",
5070         ":StandardOps",
5071         ":StandardOpsTransforms",
5072         ":StandardOpsTransformsPassIncGen",
5073         ":StandardToLLVM",
5074         ":StandardToSPIRV",
5075         ":TensorDialect",
5076         ":TensorTransforms",
5077         ":TosaDialect",
5078         ":TosaToLinalg",
5079         ":Transforms",
5080         ":TransformsPassIncGen",
5081         ":VectorOps",
5082         ":VectorToLLVM",
5083         ":VectorToROCDL",
5084         ":VectorToSCF",
5085         ":VectorToSPIRV",
5086         ":X86Vector",
5087         ":X86VectorTransforms",
5088     ],
5091 cc_binary(
5092     name = "mlir-lsp-server",
5093     srcs = ["tools/mlir-lsp-server/mlir-lsp-server.cpp"],
5094     includes = ["include"],
5095     deps = [
5096         ":AllPassesAndDialects",
5097         ":IR",
5098         ":MlirLspServerLib",
5099     ],
5102 cc_binary(
5103     name = "mlir-opt",
5104     srcs = ["tools/mlir-opt/mlir-opt.cpp"],
5105     local_defines = ["MLIR_INCLUDE_TESTS"],
5106     deps = [
5107         ":AllPassesAndDialects",
5108         ":Analysis",
5109         ":IR",
5110         ":MlirOptLib",
5111         ":OpenMPDialect",
5112         ":Pass",
5113         ":QuantOps",
5114         ":SCFToGPUPass",
5115         ":Support",
5116         ":Transforms",
5117         "//llvm:AllTargetsCodeGens",
5118         "//llvm:Support",
5119         "//mlir/test:TestAffine",
5120         "//mlir/test:TestAnalysis",
5121         "//mlir/test:TestDLTI",
5122         "//mlir/test:TestDialect",
5123         "//mlir/test:TestGPU",
5124         "//mlir/test:TestIR",
5125         "//mlir/test:TestLinalg",
5126         "//mlir/test:TestMath",
5127         "//mlir/test:TestPass",
5128         "//mlir/test:TestReducer",
5129         "//mlir/test:TestRewrite",
5130         "//mlir/test:TestSCF",
5131         "//mlir/test:TestSPIRV",
5132         "//mlir/test:TestShapeDialect",
5133         "//mlir/test:TestStandardOps",
5134         "//mlir/test:TestStandardToLLVM",
5135         "//mlir/test:TestTosaDialect",
5136         "//mlir/test:TestTransforms",
5137         "//mlir/test:TestTypeDialect",
5138         "//mlir/test:TestVector",
5139     ],
5142 cc_library(
5143     name = "MlirJitRunner",
5144     srcs = ["lib/ExecutionEngine/JitRunner.cpp"],
5145     hdrs = ["include/mlir/ExecutionEngine/JitRunner.h"],
5146     includes = ["include"],
5147     deps = [
5148         ":AllPassesAndDialects",
5149         ":ExecutionEngine",
5150         ":ExecutionEngineUtils",
5151         ":IR",
5152         ":LLVMDialect",
5153         ":LLVMToLLVMIRTranslation",
5154         ":OpenACCToLLVMIRTranslation",
5155         ":OpenMPToLLVMIRTranslation",
5156         ":Parser",
5157         ":Pass",
5158         ":SCFToStandard",
5159         ":Support",
5160         "//llvm:Core",
5161         "//llvm:OrcJIT",
5162         "//llvm:Support",
5163     ],
5166 cc_library(
5167     name = "mlir_c_runner_utils",
5168     srcs = [
5169         "lib/ExecutionEngine/CRunnerUtils.cpp",
5170         "lib/ExecutionEngine/SparseUtils.cpp",
5171     ],
5172     hdrs = ["include/mlir/ExecutionEngine/CRunnerUtils.h"],
5173     includes = ["include"],
5176 cc_library(
5177     name = "mlir_async_runtime_api",
5178     hdrs = ["include/mlir/ExecutionEngine/AsyncRuntime.h"],
5179     includes = ["include"],
5182 cc_library(
5183     name = "mlir_async_runtime",
5184     srcs = ["lib/ExecutionEngine/AsyncRuntime.cpp"],
5185     copts = ["-Dmlir_async_runtime_EXPORTS"],
5186     deps = [
5187         ":mlir_async_runtime_api",
5188         "//llvm:Support",
5189     ],
5192 cc_library(
5193     name = "mlir_runner_utils",
5194     srcs = ["lib/ExecutionEngine/RunnerUtils.cpp"],
5195     hdrs = ["include/mlir/ExecutionEngine/RunnerUtils.h"],
5196     includes = ["include"],
5197     deps = [":mlir_c_runner_utils"],
5200 cc_binary(
5201     name = "mlir-cpu-runner",
5202     srcs = ["tools/mlir-cpu-runner/mlir-cpu-runner.cpp"],
5203     deps = [
5204         ":AllToLLVMIRTranslations",
5205         ":ExecutionEngineUtils",
5206         ":IR",
5207         ":LLVMDialect",
5208         ":LLVMToLLVMIRTranslation",
5209         ":MlirJitRunner",
5210         ":OpenACCToLLVMIRTranslation",
5211         ":OpenMPToLLVMIRTranslation",
5212         ":ToLLVMIRTranslation",
5213         "//llvm:AsmParser",
5214         "//llvm:Support",
5215         "//llvm:X86AsmParser",
5216     ],
5219 # This target provides the headers from LLVM's Support target without any of
5220 # the symbols. In particular, it does not contain the static registration code
5221 # which may be executed by at most one shared library loaded by ORCJit. Direct
5222 # dependencies need to avoid requiring symbols from LLVMSupport by adding
5223 # copts = ["-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1"].
5225 # Bazel links the dependencies' object files instead of the archives, which
5226 # means that symbols are linked in even if none are used. The LLVM cmake build
5227 # on the other hand links archives (or shared libraries, depending on
5228 # BUILD_SHARED_LIBS), skipping them if none of the symbols are used.
5229 # See also https://reviews.llvm.org/D95613.
5230 cc_headers_only(
5231     name = "LLVMSupportHeaders",
5232     src = "//llvm:Support",
5235 cc_library(
5236     name = "mlir_cuda_runtime",
5237     srcs = ["lib/ExecutionEngine/CudaRuntimeWrappers.cpp"],
5238     # Prevent needing EnableABIBreakingChecks symbol from LLVMSupport.
5239     copts = ["-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1"],
5240     tags = [
5241         "manual",  # External dependency
5242         "nobuildkite",  # TODO(gcmn): Add support for this target
5243     ],
5244     deps = [
5245         ":LLVMSupportHeaders",
5246         ":mlir_c_runner_utils",
5247         "@cuda//:cuda_headers",
5248         "@cuda//:libcuda",
5249     ],
5252 cc_library(
5253     name = "VulkanRuntime",
5254     srcs = ["tools/mlir-vulkan-runner/VulkanRuntime.cpp"],
5255     hdrs = ["tools/mlir-vulkan-runner/VulkanRuntime.h"],
5256     tags = [
5257         "manual",  # External dependency
5258     ],
5259     deps = [
5260         ":IR",
5261         ":Pass",
5262         ":SPIRVDialect",
5263         ":SideEffectInterfaces",
5264         ":StandardOps",
5265         ":Support",
5266         "//llvm:Support",
5267         "@vulkan_headers",
5268         "@vulkan_sdk//:sdk",
5269     ],
5272 cc_binary(
5273     name = "tools/libvulkan-runtime-wrappers.so",
5274     srcs = ["tools/mlir-vulkan-runner/vulkan-runtime-wrappers.cpp"],
5275     linkshared = True,
5276     tags = [
5277         "manual",  # External dependency
5278     ],
5279     deps = [
5280         ":VulkanRuntime",
5281         "//llvm:Support",
5282     ],
5285 cc_binary(
5286     name = "mlir-vulkan-runner",
5287     srcs = ["tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp"],
5288     deps = [
5289         ":ExecutionEngineUtils",
5290         ":GPUDialect",
5291         ":GPUToSPIRV",
5292         ":GPUToVulkanTransforms",
5293         ":GPUTransforms",
5294         ":LLVMCommonConversion",
5295         ":LLVMDialect",
5296         ":LLVMToLLVMIRTranslation",
5297         ":MemRefDialect",
5298         ":MemRefToLLVM",
5299         ":MemRefTransforms",
5300         ":MlirJitRunner",
5301         ":Pass",
5302         ":SPIRVDialect",
5303         ":SPIRVTransforms",
5304         ":StandardOps",
5305         ":StandardToLLVM",
5306         ":StandardToSPIRV",
5307         ":ToLLVMIRTranslation",
5308         "//llvm:Support",
5309     ],
5312 cc_binary(
5313     name = "mlir-spirv-cpu-runner",
5314     srcs = ["tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp"],
5315     deps = [
5316         ":ExecutionEngineUtils",
5317         ":GPUDialect",
5318         ":GPUToSPIRV",
5319         ":GPUTransforms",
5320         ":IR",
5321         ":LLVMDialect",
5322         ":LLVMToLLVMIRTranslation",
5323         ":MemRefDialect",
5324         ":MlirJitRunner",
5325         ":Pass",
5326         ":SPIRVConversion",
5327         ":SPIRVDialect",
5328         ":SPIRVToLLVM",
5329         ":SPIRVTransforms",
5330         ":StandardOps",
5331         ":StandardToLLVM",
5332         ":ToLLVMIRTranslation",
5333         "//llvm:Core",
5334         "//llvm:Linker",
5335         "//llvm:Support",
5336     ],
5339 cc_library(
5340     name = "TableGen",
5341     srcs = glob(["lib/TableGen/*.cpp"]),
5342     hdrs = glob(["include/mlir/TableGen/*.h"]),
5343     includes = ["include"],
5344     deps = [
5345         ":Support",
5346         "//llvm:Support",
5347         "//llvm:TableGen",
5348     ],
5351 cc_library(
5352     name = "MlirTableGenMain",
5353     srcs = ["tools/mlir-tblgen/mlir-tblgen.cpp"],
5354     includes = ["include"],
5355     deps = [
5356         ":Support",
5357         ":TableGen",
5358         "//llvm:Support",
5359         "//llvm:TableGen",
5360         "//llvm:config",
5361     ],
5364 cc_binary(
5365     name = "mlir-tblgen",
5366     srcs = glob([
5367         "tools/mlir-tblgen/*.h",
5368         "tools/mlir-tblgen/*.cpp",
5369     ]),
5370     deps = [
5371         ":MlirTableGenMain",
5372         ":Support",
5373         ":TableGen",
5374         "//llvm:Support",
5375         "//llvm:TableGen",
5376         "//llvm:config",
5377     ],
5380 cc_binary(
5381     name = "mlir-linalg-ods-gen",
5382     srcs = [
5383         "tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp",
5384     ],
5385     deps = [
5386         ":IR",
5387         ":Support",
5388         "//llvm:Support",
5389         "//llvm:TableGen",
5390         "//llvm:config",
5391     ],
5394 cc_binary(
5395     name = "mlir-linalg-ods-yaml-gen",
5396     srcs = [
5397         "tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp",
5398     ],
5399     deps = [
5400         ":IR",
5401         ":Parser",
5402         ":Support",
5403         "//llvm:Support",
5404         "//llvm:TableGen",
5405         "//llvm:config",
5406     ],
5409 ## OpenACC dialect
5411 # TODO(gcmn): This is sticking td files in a cc_library
5412 gentbl_cc_library(
5413     name = "AccCommonGen",
5414     includes = ["/llvm/include"],
5415     strip_include_prefix = "include",
5416     tbl_outs = [
5417         (
5418             ["-gen-directive-decl"],
5419             "include/mlir/Dialect/OpenACC/AccCommon.td",
5420         ),
5421     ],
5422     tblgen = ":mlir-tblgen",
5423     td_file = "//llvm:include/llvm/Frontend/OpenACC/ACC.td",
5424     deps = ["//llvm:acc_td_files"],
5427 td_library(
5428     name = "OpenAccOpsTdFiles",
5429     srcs = [
5430         "include/mlir/Dialect/OpenACC/AccCommon.td",
5431         "include/mlir/Dialect/OpenACC/OpenACCOps.td",
5432     ],
5433     includes = ["include"],
5434     deps = [":OpBaseTdFiles"],
5437 gentbl_cc_library(
5438     name = "OpenACCOpsIncGen",
5439     strip_include_prefix = "include",
5440     tbl_outs = [
5441         (
5442             [
5443                 "-gen-dialect-decls",
5444                 "-dialect=acc",
5445             ],
5446             "include/mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc",
5447         ),
5448         (
5449             [
5450                 "-gen-dialect-defs",
5451                 "-dialect=acc",
5452             ],
5453             "include/mlir/Dialect/OpenACC/OpenACCOpsDialect.cpp.inc",
5454         ),
5455         (
5456             ["-gen-op-decls"],
5457             "include/mlir/Dialect/OpenACC/OpenACCOps.h.inc",
5458         ),
5459         (
5460             ["-gen-op-defs"],
5461             "include/mlir/Dialect/OpenACC/OpenACCOps.cpp.inc",
5462         ),
5463         (
5464             ["-gen-enum-decls"],
5465             "include/mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc",
5466         ),
5467         (
5468             ["-gen-enum-defs"],
5469             "include/mlir/Dialect/OpenACC/OpenACCOpsEnums.cpp.inc",
5470         ),
5471         (
5472             ["-gen-op-doc"],
5473             "g3doc/Dialects/OpenACC/OpenACCOps.md",
5474         ),
5475     ],
5476     tblgen = ":mlir-tblgen",
5477     td_file = "include/mlir/Dialect/OpenACC/OpenACCOps.td",
5478     deps = [":OpenAccOpsTdFiles"],
5481 cc_library(
5482     name = "OpenACCDialect",
5483     srcs = glob(
5484         [
5485             "lib/Dialect/OpenACC/IR/*.cpp",
5486             "lib/Dialect/OpenACC/IR/*.h",
5487         ],
5488     ),
5489     hdrs = glob([
5490         "include/mlir/Dialect/OpenACC/*.h",
5491     ]),
5492     includes = ["include"],
5493     deps = [
5494         ":IR",
5495         ":OpenACCOpsIncGen",
5496         ":StandardOps",
5497         ":Transforms",
5498         "//llvm:Support",
5499     ],
5502 ## OpenMP dialect
5504 # TODO(gcmn): This is sticking td files in a cc_library
5505 gentbl_cc_library(
5506     name = "OmpCommonTdGen",
5507     includes = ["/llvm/include"],
5508     strip_include_prefix = "include",
5509     tbl_outs = [
5510         (
5511             ["-gen-directive-decl"],
5512             "include/mlir/Dialect/OpenMP/OmpCommon.td",
5513         ),
5514     ],
5515     tblgen = ":mlir-tblgen",
5516     td_file = "//llvm:include/llvm/Frontend/OpenMP/OMP.td",
5517     deps = [
5518         ":OpBaseTdFiles",
5519         "//llvm:omp_td_files",
5520     ],
5523 td_library(
5524     name = "OpenMPOpsTdFiles",
5525     srcs = [
5526         "include/mlir/Dialect/OpenMP/OmpCommon.td",
5527         "include/mlir/Dialect/OpenMP/OpenMPOps.td",
5528     ],
5529     deps = [
5530         ":LLVMOpsTdFiles",
5531         ":OpBaseTdFiles",
5532     ],
5535 gentbl_cc_library(
5536     name = "OpenMPOpsIncGen",
5537     strip_include_prefix = "include",
5538     tbl_outs = [
5539         (
5540             ["-gen-op-decls"],
5541             "include/mlir/Dialect/OpenMP/OpenMPOps.h.inc",
5542         ),
5543         (
5544             ["-gen-op-defs"],
5545             "include/mlir/Dialect/OpenMP/OpenMPOps.cpp.inc",
5546         ),
5547         (
5548             ["-gen-enum-decls"],
5549             "include/mlir/Dialect/OpenMP/OpenMPOpsEnums.h.inc",
5550         ),
5551         (
5552             ["-gen-enum-defs"],
5553             "include/mlir/Dialect/OpenMP/OpenMPOpsEnums.cpp.inc",
5554         ),
5555         (
5556             [
5557                 "-gen-dialect-decls",
5558                 "-dialect=omp",
5559             ],
5560             "include/mlir/Dialect/OpenMP/OpenMPOpsDialect.h.inc",
5561         ),
5562         (
5563             [
5564                 "-gen-dialect-defs",
5565                 "-dialect=omp",
5566             ],
5567             "include/mlir/Dialect/OpenMP/OpenMPOpsDialect.cpp.inc",
5568         ),
5569         (
5570             ["-gen-type-interface-decls"],
5571             "include/mlir/Dialect/OpenMP/OpenMPTypeInterfaces.h.inc",
5572         ),
5573         (
5574             ["-gen-type-interface-defs"],
5575             "include/mlir/Dialect/OpenMP/OpenMPTypeInterfaces.cpp.inc",
5576         ),
5577         (
5578             ["-gen-op-doc"],
5579             "g3doc/Dialects/OpenMP/OpenMPOps.md",
5580         ),
5581     ],
5582     tblgen = ":mlir-tblgen",
5583     td_file = "include/mlir/Dialect/OpenMP/OpenMPOps.td",
5584     deps = [":OpenMPOpsTdFiles"],
5587 cc_library(
5588     name = "OpenMPDialect",
5589     srcs = glob(
5590         [
5591             "lib/Dialect/OpenMP/IR/*.cpp",
5592             "lib/Dialect/OpenMP/IR/*.h",
5593         ],
5594     ),
5595     hdrs = glob([
5596         "include/mlir/Dialect/OpenMP/*.h",
5597     ]),
5598     includes = ["include"],
5599     deps = [
5600         ":ControlFlowInterfaces",
5601         ":IR",
5602         ":LLVMDialect",
5603         ":OpenMPOpsIncGen",
5604         ":SideEffectInterfaces",
5605         ":StandardOps",
5606         "//llvm:Support",
5607     ],
5610 cc_library(
5611     name = "OpenACCToSCF",
5612     srcs = glob([
5613         "lib/Conversion/OpenACCToSCF/*.cpp",
5614         "lib/Conversion/OpenACCToSCF/*.h",
5615     ]) + ["lib/Conversion/PassDetail.h"],
5616     hdrs = glob([
5617         "include/mlir/Conversion/OpenACCToSCF/*.h",
5618     ]),
5619     includes = ["include"],
5620     deps = [
5621         ":ConversionPassIncGen",
5622         ":IR",
5623         ":OpenACCDialect",
5624         ":Pass",
5625         ":SCFDialect",
5626         ":StandardOps",
5627         ":Transforms",
5628     ],
5631 cc_library(
5632     name = "OpenACCToLLVM",
5633     srcs = glob([
5634         "lib/Conversion/OpenACCToLLVM/*.cpp",
5635         "lib/Conversion/OpenACCToLLVM/*.h",
5636     ]) + ["lib/Conversion/PassDetail.h"],
5637     hdrs = glob([
5638         "include/mlir/Conversion/OpenACCToLLVM/*.h",
5639     ]),
5640     includes = ["include"],
5641     deps = [
5642         ":ConversionPassIncGen",
5643         ":IR",
5644         ":LLVMCommonConversion",
5645         ":LLVMDialect",
5646         ":OpenACCDialect",
5647         ":Pass",
5648         ":StandardOps",
5649         ":Transforms",
5650         "//llvm:Core",
5651         "//llvm:Support",
5652     ],
5655 cc_library(
5656     name = "OpenMPToLLVM",
5657     srcs = glob([
5658         "lib/Conversion/OpenMPToLLVM/*.cpp",
5659         "lib/Conversion/OpenMPToLLVM/*.h",
5660     ]) + ["lib/Conversion/PassDetail.h"],
5661     hdrs = glob([
5662         "include/mlir/Conversion/OpenMPToLLVM/*.h",
5663     ]),
5664     includes = ["include"],
5665     deps = [
5666         ":ConversionPassIncGen",
5667         ":IR",
5668         ":LLVMCommonConversion",
5669         ":LLVMDialect",
5670         ":MemRefToLLVM",
5671         ":OpenMPDialect",
5672         ":Pass",
5673         ":StandardOps",
5674         ":StandardToLLVM",
5675         ":Transforms",
5676         "//llvm:Core",
5677         "//llvm:Support",
5678     ],
5681 td_library(
5682     name = "QuantizationOpsTdFiles",
5683     srcs = [
5684         "include/mlir/Dialect/Quant/QuantOps.td",
5685         "include/mlir/Dialect/Quant/QuantOpsBase.td",
5686     ],
5687     includes = ["include"],
5688     deps = [
5689         ":OpBaseTdFiles",
5690         ":SideEffectInterfacesTdFiles",
5691     ],
5694 gentbl_cc_library(
5695     name = "QuantOpsIncGen",
5696     strip_include_prefix = "include",
5697     tbl_outs = [
5698         (
5699             ["-gen-op-decls"],
5700             "include/mlir/Dialect/Quant/QuantOps.h.inc",
5701         ),
5702         (
5703             ["-gen-op-defs"],
5704             "include/mlir/Dialect/Quant/QuantOps.cpp.inc",
5705         ),
5706         (
5707             ["-gen-dialect-decls"],
5708             "include/mlir/Dialect/Quant/QuantOpsDialect.h.inc",
5709         ),
5710         (
5711             ["-gen-dialect-defs"],
5712             "include/mlir/Dialect/Quant/QuantOpsDialect.cpp.inc",
5713         ),
5714         (
5715             ["-gen-op-doc"],
5716             "g3doc/Dialects/QuantOps/QuantOps.md",
5717         ),
5718     ],
5719     tblgen = ":mlir-tblgen",
5720     td_file = "include/mlir/Dialect/Quant/QuantOps.td",
5721     deps = [":QuantizationOpsTdFiles"],
5724 gentbl_cc_library(
5725     name = "QuantPassIncGen",
5726     strip_include_prefix = "include",
5727     tbl_outs = [
5728         (
5729             [
5730                 "-gen-pass-decls",
5731                 "-name=Quant",
5732             ],
5733             "include/mlir/Dialect/Quant/Passes.h.inc",
5734         ),
5735     ],
5736     tblgen = ":mlir-tblgen",
5737     td_file = "include/mlir/Dialect/Quant/Passes.td",
5738     deps = [":PassBaseTdFiles"],
5741 cc_library(
5742     name = "QuantOps",
5743     srcs = [
5744         "lib/Dialect/Quant/IR/QuantOps.cpp",
5745         "lib/Dialect/Quant/IR/QuantTypes.cpp",
5746         "lib/Dialect/Quant/IR/TypeDetail.h",
5747         "lib/Dialect/Quant/IR/TypeParser.cpp",
5748         "lib/Dialect/Quant/Transforms/ConvertConst.cpp",
5749         "lib/Dialect/Quant/Transforms/ConvertSimQuant.cpp",
5750         "lib/Dialect/Quant/Transforms/PassDetail.h",
5751         "lib/Dialect/Quant/Utils/FakeQuantSupport.cpp",
5752         "lib/Dialect/Quant/Utils/QuantizeUtils.cpp",
5753         "lib/Dialect/Quant/Utils/UniformSupport.cpp",
5754     ],
5755     hdrs = [
5756         "include/mlir/Dialect/Quant/FakeQuantSupport.h",
5757         "include/mlir/Dialect/Quant/Passes.h",
5758         "include/mlir/Dialect/Quant/QuantOps.h",
5759         "include/mlir/Dialect/Quant/QuantTypes.h",
5760         "include/mlir/Dialect/Quant/QuantizeUtils.h",
5761         "include/mlir/Dialect/Quant/UniformSupport.h",
5762     ],
5763     includes = ["include"],
5764     deps = [
5765         ":IR",
5766         ":Pass",
5767         ":QuantOpsIncGen",
5768         ":QuantPassIncGen",
5769         ":SideEffectInterfaces",
5770         ":StandardOps",
5771         ":TransformUtils",
5772         "//llvm:Support",
5773     ],
5776 td_library(
5777     name = "LinalgOpsTdFiles",
5778     srcs = [
5779         "include/mlir/Dialect/Linalg/IR/LinalgBase.td",
5780         "include/mlir/Dialect/Linalg/IR/LinalgOps.td",
5781     ],
5782     includes = ["include"],
5783     deps = [
5784         ":ControlFlowInterfacesTdFiles",
5785         ":InferTypeOpInterfaceTdFiles",
5786         ":LoopLikeInterfaceTdFiles",
5787         ":OpBaseTdFiles",
5788         ":SideEffectInterfacesTdFiles",
5789         ":ViewLikeInterfaceTdFiles",
5790     ],
5793 gentbl_cc_library(
5794     name = "LinalgOpsIncGen",
5795     strip_include_prefix = "include",
5796     tbl_outs = [
5797         (
5798             ["-gen-op-decls"],
5799             "include/mlir/Dialect/Linalg/IR/LinalgOps.h.inc",
5800         ),
5801         (
5802             ["-gen-op-defs"],
5803             "include/mlir/Dialect/Linalg/IR/LinalgOps.cpp.inc",
5804         ),
5805         (
5806             [
5807                 "-gen-dialect-decls",
5808                 "-dialect=linalg",
5809             ],
5810             "include/mlir/Dialect/Linalg/IR/LinalgOpsDialect.h.inc",
5811         ),
5812         (
5813             [
5814                 "-gen-dialect-defs",
5815                 "-dialect=linalg",
5816             ],
5817             "include/mlir/Dialect/Linalg/IR/LinalgOpsDialect.cpp.inc",
5818         ),
5819     ],
5820     tblgen = ":mlir-tblgen",
5821     td_file = "include/mlir/Dialect/Linalg/IR/LinalgOps.td",
5822     deps = [":LinalgOpsTdFiles"],
5825 genlinalg(
5826     name = "LinalgNamedStructuredOpsTcIncGen",
5827     src = "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc",
5828     linalg_outs = [
5829         (
5830             "-gen-impl -o=$@",
5831             "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.tcgen.cpp.inc",
5832         ),
5833         (
5834             "-gen-ods-decl -o=$@",
5835             "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.tcgen.td",
5836         ),
5837     ],
5838     linalggen = ":mlir-linalg-ods-gen",
5841 genlinalg(
5842     name = "LinalgNamedStructuredOpsYamlIncGen",
5843     src = "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml",
5844     linalg_outs = [
5845         (
5846             "-o-impl=$@",
5847             "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.cpp.inc",
5848         ),
5849         (
5850             "-o-ods-decl=$@",
5851             "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.td",
5852         ),
5853     ],
5854     linalggen = ":mlir-linalg-ods-yaml-gen",
5857 td_library(
5858     name = "LinalgStructuredOpsTdFiles",
5859     srcs = [
5860         "include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td",
5861         "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.tcgen.td",
5862         "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.td",
5863         "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td",
5864     ],
5865     includes = ["include"],
5866     deps = [
5867         ":CopyOpInterfaceTdFiles",
5868         ":LinalgOpsTdFiles",
5869         ":OpBaseTdFiles",
5870         ":SideEffectInterfacesTdFiles",
5871     ],
5874 gentbl_cc_library(
5875     name = "LinalgStructuredOpsIncGen",
5876     strip_include_prefix = "include",
5877     tbl_outs = [
5878         (
5879             ["-gen-op-decls"],
5880             "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.h.inc",
5881         ),
5882         (
5883             ["-gen-op-defs"],
5884             "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc",
5885         ),
5886     ],
5887     tblgen = ":mlir-tblgen",
5888     td_file = "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td",
5889     deps = [":LinalgStructuredOpsTdFiles"],
5892 gentbl_cc_library(
5893     name = "LinalgInterfacesIncGen",
5894     strip_include_prefix = "include",
5895     tbl_outs = [
5896         (
5897             ["-gen-op-interface-decls"],
5898             "include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h.inc",
5899         ),
5900         (
5901             ["-gen-op-interface-defs"],
5902             "include/mlir/Dialect/Linalg/IR/LinalgInterfaces.cpp.inc",
5903         ),
5904     ],
5905     tblgen = ":mlir-tblgen",
5906     td_file = "include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td",
5907     deps = [":LinalgStructuredOpsTdFiles"],
5910 td_library(
5911     name = "LinalgDocTdFiles",
5912     srcs = ["include/mlir/Dialect/Linalg/IR/LinalgDoc.td"],
5913     includes = ["include"],
5914     deps = [
5915         ":LinalgOpsTdFiles",
5916         ":LinalgStructuredOpsTdFiles",
5917     ],
5920 gentbl_cc_library(
5921     name = "LinalgDocIncGen",
5922     strip_include_prefix = "include",
5923     tbl_outs = [
5924         (
5925             ["-gen-op-doc"],
5926             "g3doc/Dialects/Linalg/LinalgOps.md",
5927         ),
5928     ],
5929     tblgen = ":mlir-tblgen",
5930     td_file = "include/mlir/Dialect/Linalg/IR/LinalgDoc.td",
5931     deps = [":LinalgDocTdFiles"],
5934 cc_library(
5935     name = "LinalgToLLVM",
5936     srcs = glob([
5937         "lib/Conversion/LinalgToLLVM/*.cpp",
5938         "lib/Conversion/LinalgToLLVM/*.h",
5939     ]) + ["lib/Conversion/PassDetail.h"],
5940     hdrs = glob([
5941         "include/mlir/Conversion/LinalgToLLVM/*.h",
5942     ]),
5943     includes = ["include"],
5944     deps = [
5945         ":AffineToStandard",
5946         ":Analysis",
5947         ":ConversionPassIncGen",
5948         ":IR",
5949         ":LLVMCommonConversion",
5950         ":LLVMDialect",
5951         ":LinalgOps",
5952         ":LinalgTransforms",
5953         ":MemRefToLLVM",
5954         ":Pass",
5955         ":SCFDialect",
5956         ":SCFToStandard",
5957         ":StandardOps",
5958         ":Support",
5959         ":Transforms",
5960         ":VectorToLLVM",
5961         ":VectorToSCF",
5962         "//llvm:Core",
5963         "//llvm:Support",
5964     ],
5967 cc_library(
5968     name = "LinalgToStandard",
5969     srcs = glob([
5970         "lib/Conversion/LinalgToStandard/*.cpp",
5971         "lib/Conversion/LinalgToStandard/*.h",
5972     ]) + ["lib/Conversion/PassDetail.h"],
5973     hdrs = glob([
5974         "include/mlir/Conversion/LinalgToStandard/*.h",
5975     ]),
5976     includes = ["include"],
5977     deps = [
5978         ":Affine",
5979         ":ConversionPassIncGen",
5980         ":IR",
5981         ":LinalgOps",
5982         ":LinalgTransforms",
5983         ":MemRefDialect",
5984         ":Pass",
5985         ":SCFDialect",
5986         ":StandardOps",
5987         ":Support",
5988         ":Transforms",
5989         "//llvm:Core",
5990         "//llvm:Support",
5991     ],
5994 cc_library(
5995     name = "LinalgToSPIRV",
5996     srcs = glob([
5997         "lib/Conversion/LinalgToSPIRV/*.cpp",
5998         "lib/Conversion/LinalgToSPIRV/*.h",
5999     ]) + ["lib/Conversion/PassDetail.h"],
6000     hdrs = glob([
6001         "include/mlir/Conversion/LinalgToSPIRV/*.h",
6002     ]),
6003     includes = ["include"],
6004     deps = [
6005         ":ConversionPassIncGen",
6006         ":DialectUtils",
6007         ":IR",
6008         ":LinalgOps",
6009         ":LinalgTransforms",
6010         ":Pass",
6011         ":SPIRVConversion",
6012         ":SPIRVDialect",
6013         ":StandardOps",
6014         ":TransformUtils",
6015     ],
6018 cc_library(
6019     name = "LinalgOps",
6020     srcs = [
6021         "lib/Dialect/Linalg/IR/LinalgOps.cpp",
6022         "lib/Dialect/Linalg/IR/LinalgTypes.cpp",
6023     ],
6024     hdrs = [
6025         "include/mlir/Dialect/Linalg/IR/LinalgOps.h",
6026         "include/mlir/Dialect/Linalg/IR/LinalgTypes.h",
6027     ],
6028     includes = ["include"],
6029     deps = [
6030         ":Affine",
6031         ":CopyOpInterface",
6032         ":DialectUtils",
6033         ":IR",
6034         ":InferTypeOpInterface",
6035         ":LinalgInterfaces",
6036         ":LinalgInterfacesIncGen",
6037         ":LinalgNamedStructuredOpsTcIncGen",
6038         ":LinalgNamedStructuredOpsYamlIncGen",
6039         ":LinalgOpsIncGen",
6040         ":LinalgStructuredOpsIncGen",
6041         ":MathDialect",
6042         ":MemRefDialect",
6043         ":Parser",
6044         ":SideEffectInterfaces",
6045         ":StandardOps",
6046         ":Support",
6047         ":TensorDialect",
6048         ":ViewLikeInterface",
6049         "//llvm:Support",
6050     ],
6053 gentbl_cc_library(
6054     name = "LinalgPassIncGen",
6055     strip_include_prefix = "include",
6056     tbl_outs = [
6057         (
6058             [
6059                 "-gen-pass-decls",
6060                 "-name=Linalg",
6061             ],
6062             "include/mlir/Dialect/Linalg/Passes.h.inc",
6063         ),
6064         (
6065             [
6066                 "-gen-pass-capi-header",
6067                 "--prefix=Linalg",
6068             ],
6069             "include/mlir/Dialect/Linalg/Passes.capi.h.inc",
6070         ),
6071         (
6072             [
6073                 "-gen-pass-capi-impl",
6074                 "--prefix=Linalg",
6075             ],
6076             "include/mlir/Dialect/Linalg/Passes.capi.cpp.inc",
6077         ),
6078     ],
6079     tblgen = ":mlir-tblgen",
6080     td_file = "include/mlir/Dialect/Linalg/Passes.td",
6081     deps = [":PassBaseTdFiles"],
6084 cc_library(
6085     name = "LinalgTransforms",
6086     srcs = glob([
6087         "lib/Dialect/Linalg/Transforms/*.cpp",
6088         "lib/Dialect/Linalg/Transforms/*.h",
6089     ]) + [
6090         "lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp",
6091         "lib/Dialect/Linalg/Utils/Utils.cpp",
6092     ],
6093     hdrs = [
6094         "include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h",
6095         "include/mlir/Dialect/Linalg/Passes.h",
6096         "include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h",
6097         "include/mlir/Dialect/Linalg/Transforms/Hoisting.h",
6098         "include/mlir/Dialect/Linalg/Transforms/Transforms.h",
6099         "include/mlir/Dialect/Linalg/Utils/Utils.h",
6100     ],
6101     includes = ["include"],
6102     deps = [
6103         ":Affine",
6104         ":AffineUtils",
6105         ":Analysis",
6106         ":ComplexDialect",
6107         ":DialectUtils",
6108         ":IR",
6109         ":LinalgOps",
6110         ":LinalgPassIncGen",
6111         ":LinalgStructuredOpsIncGen",
6112         ":MathDialect",
6113         ":MemRefDialect",
6114         ":Pass",
6115         ":SCFDialect",
6116         ":SCFTransforms",
6117         ":StandardOps",
6118         ":StandardOpsTransforms",
6119         ":Support",
6120         ":TensorDialect",
6121         ":TransformUtils",
6122         ":VectorOps",
6123         ":VectorToSCF",
6124         "//llvm:Support",
6125     ],
6128 td_library(
6129     name = "VectorOpsTdFiles",
6130     srcs = ["include/mlir/Dialect/Vector/VectorOps.td"],
6131     includes = ["include"],
6132     deps = [
6133         ":OpBaseTdFiles",
6134         ":SideEffectInterfacesTdFiles",
6135         ":VectorInterfacesTdFiles",
6136         ":ViewLikeInterfaceTdFiles",
6137     ],
6140 gentbl_cc_library(
6141     name = "VectorOpsIncGen",
6142     strip_include_prefix = "include",
6143     tbl_outs = [
6144         (
6145             ["-gen-op-decls"],
6146             "include/mlir/Dialect/Vector/VectorOps.h.inc",
6147         ),
6148         (
6149             ["-gen-op-defs"],
6150             "include/mlir/Dialect/Vector/VectorOps.cpp.inc",
6151         ),
6152         (
6153             [
6154                 "-gen-dialect-decls",
6155                 "-dialect=vector",
6156             ],
6157             "include/mlir/Dialect/Vector/VectorOpsDialect.h.inc",
6158         ),
6159         (
6160             [
6161                 "-gen-dialect-defs",
6162                 "-dialect=vector",
6163             ],
6164             "include/mlir/Dialect/Vector/VectorOpsDialect.cpp.inc",
6165         ),
6166         (
6167             ["-gen-enum-decls"],
6168             "include/mlir/Dialect/Vector/VectorOpsEnums.h.inc",
6169         ),
6170         (
6171             ["-gen-enum-defs"],
6172             "include/mlir/Dialect/Vector/VectorOpsEnums.cpp.inc",
6173         ),
6174         (
6175             ["-gen-op-doc"],
6176             "g3doc/Dialects/Vector/VectorOps.md",
6177         ),
6178     ],
6179     tblgen = ":mlir-tblgen",
6180     td_file = "include/mlir/Dialect/Vector/VectorOps.td",
6181     deps = [":VectorOpsTdFiles"],
6184 cc_library(
6185     name = "VectorToLLVM",
6186     srcs = glob([
6187         "lib/Conversion/VectorToLLVM/*.cpp",
6188         "lib/Conversion/VectorToLLVM/*.h",
6189     ]) + ["lib/Conversion/PassDetail.h"],
6190     hdrs = glob([
6191         "include/mlir/Conversion/VectorToLLVM/*.h",
6192     ]),
6193     includes = ["include"],
6194     deps = [
6195         ":AMX",
6196         ":AMXTransforms",
6197         ":ArmNeon",
6198         ":ArmSVE",
6199         ":ArmSVETransforms",
6200         ":ConversionPassIncGen",
6201         ":DialectUtils",
6202         ":IR",
6203         ":LLVMCommonConversion",
6204         ":LLVMDialect",
6205         ":MemRefDialect",
6206         ":Pass",
6207         ":StandardOps",
6208         ":Support",
6209         ":ToLLVMIRTranslation",
6210         ":Transforms",
6211         ":VectorOps",
6212         ":X86Vector",
6213         ":X86VectorTransforms",
6214         "//llvm:Core",
6215         "//llvm:Support",
6216     ],
6219 cc_library(
6220     name = "VectorToGPU",
6221     srcs = glob([
6222         "lib/Conversion/VectorToGPU/*.cpp",
6223         "lib/Conversion/VectorToGPU/*.h",
6224     ]) + ["lib/Conversion/PassDetail.h"],
6225     hdrs = glob([
6226         "include/mlir/Conversion/VectorToGPU/*.h",
6227     ]),
6228     includes = ["include"],
6229     deps = [
6230         ":Affine",
6231         ":Analysis",
6232         ":ConversionPassIncGen",
6233         ":DialectUtils",
6234         ":GPUDialect",
6235         ":IR",
6236         ":LLVMDialect",
6237         ":MemRefDialect",
6238         ":Pass",
6239         ":SCFDialect",
6240         ":StandardOps",
6241         ":StandardToLLVM",
6242         ":Support",
6243         ":Transforms",
6244         ":VectorOps",
6245         "//llvm:Core",
6246         "//llvm:Support",
6247     ],
6250 cc_library(
6251     name = "VectorToSCF",
6252     srcs = glob([
6253         "lib/Conversion/VectorToSCF/*.cpp",
6254         "lib/Conversion/VectorToSCF/*.h",
6255     ]) + ["lib/Conversion/PassDetail.h"],
6256     hdrs = glob([
6257         "include/mlir/Conversion/VectorToSCF/*.h",
6258     ]),
6259     includes = ["include"],
6260     deps = [
6261         ":Affine",
6262         ":AffineUtils",
6263         ":ConversionPassIncGen",
6264         ":IR",
6265         ":LLVMDialect",
6266         ":MemRefDialect",
6267         ":Pass",
6268         ":SCFDialect",
6269         ":StandardOps",
6270         ":StandardToLLVM",
6271         ":Support",
6272         ":Transforms",
6273         ":VectorOps",
6274         "//llvm:Core",
6275         "//llvm:Support",
6276     ],
6279 td_library(
6280     name = "TosaDialectTdFiles",
6281     srcs = glob(["include/mlir/Dialect/Tosa/IR/*.td"]),
6282     deps = [
6283         ":InferTypeOpInterfaceTdFiles",
6284         ":LoopLikeInterfaceTdFiles",
6285         ":OpBaseTdFiles",
6286         ":SideEffectInterfacesTdFiles",
6287     ],
6290 gentbl_cc_library(
6291     name = "TosaDialectIncGen",
6292     strip_include_prefix = "include",
6293     tbl_outs = [
6294         (
6295             ["-gen-op-decls"],
6296             "include/mlir/Dialect/Tosa/IR/TosaOps.h.inc",
6297         ),
6298         (
6299             ["-gen-op-defs"],
6300             "include/mlir/Dialect/Tosa/IR/TosaOps.cpp.inc",
6301         ),
6302         (
6303             ["-gen-struct-attr-decls"],
6304             "include/mlir/Dialect/Tosa/IR/TosaStructs.h.inc",
6305         ),
6306         (
6307             ["-gen-struct-attr-defs"],
6308             "include/mlir/Dialect/Tosa/IR/TosaStructs.cpp.inc",
6309         ),
6310         (
6311             ["-gen-dialect-decls"],
6312             "include/mlir/Dialect/Tosa/IR/TosaOpsDialect.h.inc",
6313         ),
6314         (
6315             ["-gen-dialect-defs"],
6316             "include/mlir/Dialect/Tosa/IR/TosaOpsDialect.cpp.inc",
6317         ),
6318         (
6319             ["-gen-op-doc"],
6320             "g3doc/Dialects/Tosa/TosaOps.md",
6321         ),
6322     ],
6323     tblgen = ":mlir-tblgen",
6324     td_file = "include/mlir/Dialect/Tosa/IR/TosaOps.td",
6325     deps = [":TosaDialectTdFiles"],
6328 gentbl_cc_library(
6329     name = "TosaInterfacesIncGen",
6330     strip_include_prefix = "include",
6331     tbl_outs = [
6332         (
6333             ["-gen-op-interface-decls"],
6334             "include/mlir/Dialect/Tosa/IR/TosaInterfaces.h.inc",
6335         ),
6336         (
6337             ["-gen-op-interface-defs"],
6338             "include/mlir/Dialect/Tosa/IR/TosaInterfaces.cpp.inc",
6339         ),
6340     ],
6341     tblgen = ":mlir-tblgen",
6342     td_file = "include/mlir/Dialect/Tosa/IR/TosaInterfaces.td",
6343     deps = [":TosaDialectTdFiles"],
6346 gentbl_cc_library(
6347     name = "TosaPassIncGen",
6348     strip_include_prefix = "include",
6349     tbl_outs = [
6350         (
6351             [
6352                 "-gen-pass-decls",
6353                 "-name=TosaOpt",
6354             ],
6355             "include/mlir/Dialect/Tosa/Transforms/Passes.h.inc",
6356         ),
6357     ],
6358     tblgen = ":mlir-tblgen",
6359     td_file = "include/mlir/Dialect/Tosa/Transforms/Passes.td",
6360     deps = [":PassBaseTdFiles"],
6363 cc_library(
6364     name = "TosaDialect",
6365     srcs = glob([
6366         "lib/Dialect/Tosa/IR/*.cpp",
6367         "lib/Dialect/Tosa/IR/*.h",
6368         "lib/Dialect/Tosa/Utils/*.cpp",
6369         "lib/Dialect/Tosa/Transforms/*.cpp",
6370     ]),
6371     hdrs = glob([
6372         "include/mlir/Dialect/Tosa/IR/*.h",
6373         "include/mlir/Dialect/Tosa/Utils/*.h",
6374         "include/mlir/Dialect/Tosa/Transforms/*.h",
6375     ]),
6376     includes = ["include"],
6377     deps = [
6378         ":Analysis",
6379         ":Dialect",
6380         ":IR",
6381         ":InferTypeOpInterface",
6382         ":LoopLikeInterface",
6383         ":Pass",
6384         ":QuantOps",
6385         ":SideEffectInterfaces",
6386         ":StandardOps",
6387         ":TensorDialect",
6388         ":TosaDialectIncGen",
6389         ":TosaInterfacesIncGen",
6390         ":TosaPassIncGen",
6391         ":TransformUtils",
6392         "//llvm:Support",
6393     ],
6396 cc_library(
6397     name = "TosaToLinalg",
6398     srcs = glob([
6399         "lib/Conversion/TosaToLinalg/*.cpp",
6400         "lib/Conversion/TosaToLinalg/*.h",
6401     ]) + ["lib/Conversion/PassDetail.h"],
6402     hdrs = glob([
6403         "include/mlir/Conversion/TosaToLinalg/*.h",
6404     ]),
6405     includes = [
6406         "include",
6407         "lib/Conversion/TosaToLinalg",
6408     ],
6409     deps = [
6410         ":ConversionPassIncGen",
6411         ":DialectUtils",
6412         ":IR",
6413         ":LinalgOps",
6414         ":MathDialect",
6415         ":Pass",
6416         ":StandardOps",
6417         ":TensorDialect",
6418         ":TosaDialect",
6419         ":Transforms",
6420     ],
6423 cc_library(
6424     name = "TosaToSCF",
6425     srcs = glob([
6426         "lib/Conversion/TosaToSCF/*.cpp",
6427         "lib/Conversion/TosaToSCF/*.h",
6428     ]) + ["lib/Conversion/PassDetail.h"],
6429     hdrs = glob([
6430         "include/mlir/Conversion/TosaToSCF/*.h",
6431     ]),
6432     includes = [
6433         "include",
6434         "lib/Conversion/TosaToSCF",
6435     ],
6436     deps = [
6437         ":ConversionPassIncGen",
6438         ":IR",
6439         ":Pass",
6440         ":SCFDialect",
6441         ":TensorDialect",
6442         ":TosaDialect",
6443         ":Transforms",
6444     ],
6447 cc_library(
6448     name = "TosaToStandard",
6449     srcs = glob([
6450         "lib/Conversion/TosaToStandard/*.cpp",
6451         "lib/Conversion/TosaToStandard/*.h",
6452     ]) + ["lib/Conversion/PassDetail.h"],
6453     hdrs = glob([
6454         "include/mlir/Conversion/TosaToStandard/*.h",
6455     ]),
6456     includes = [
6457         "include",
6458         "lib/Conversion/TosaToStandard",
6459     ],
6460     deps = [
6461         ":ConversionPassIncGen",
6462         ":IR",
6463         ":Pass",
6464         ":StandardOps",
6465         ":TensorDialect",
6466         ":TosaDialect",
6467         ":Transforms",
6468     ],
6471 td_library(
6472     name = "ComplexOpsTdFiles",
6473     srcs = [
6474         "include/mlir/Dialect/Complex/IR/ComplexBase.td",
6475         "include/mlir/Dialect/Complex/IR/ComplexOps.td",
6476     ],
6477     includes = ["include"],
6478     deps = [
6479         ":OpBaseTdFiles",
6480         ":SideEffectInterfacesTdFiles",
6481     ],
6484 gentbl_cc_library(
6485     name = "ComplexBaseIncGen",
6486     strip_include_prefix = "include",
6487     tbl_outs = [
6488         (
6489             [
6490                 "-gen-dialect-decls",
6491                 "-dialect=complex",
6492             ],
6493             "include/mlir/Dialect/Complex/IR/ComplexOpsDialect.h.inc",
6494         ),
6495         (
6496             [
6497                 "-gen-dialect-defs",
6498                 "-dialect=complex",
6499             ],
6500             "include/mlir/Dialect/Complex/IR/ComplexOpsDialect.cpp.inc",
6501         ),
6502     ],
6503     tblgen = ":mlir-tblgen",
6504     td_file = "include/mlir/Dialect/Complex/IR/ComplexBase.td",
6505     deps = [":ComplexOpsTdFiles"],
6508 gentbl_cc_library(
6509     name = "ComplexOpsIncGen",
6510     strip_include_prefix = "include",
6511     tbl_outs = [
6512         (
6513             ["-gen-op-decls"],
6514             "include/mlir/Dialect/Complex/IR/ComplexOps.h.inc",
6515         ),
6516         (
6517             ["-gen-op-defs"],
6518             "include/mlir/Dialect/Complex/IR/ComplexOps.cpp.inc",
6519         ),
6520     ],
6521     tblgen = ":mlir-tblgen",
6522     td_file = "include/mlir/Dialect/Complex/IR/ComplexOps.td",
6523     deps = [":ComplexOpsTdFiles"],
6526 cc_library(
6527     name = "ComplexDialect",
6528     srcs = glob(
6529         [
6530             "lib/Dialect/Complex/IR/*.cpp",
6531             "lib/Dialect/Complex/IR/*.h",
6532         ],
6533     ),
6534     hdrs = ["include/mlir/Dialect/Complex/IR/Complex.h"],
6535     includes = ["include"],
6536     deps = [
6537         ":ComplexBaseIncGen",
6538         ":ComplexOpsIncGen",
6539         ":IR",
6540         ":SideEffectInterfaces",
6541         ":Support",
6542         ":VectorInterfaces",
6543         "//llvm:Support",
6544     ],
6547 cc_library(
6548     name = "ComplexToLLVM",
6549     srcs = glob([
6550         "lib/Conversion/ComplexToLLVM/*.cpp",
6551         "lib/Conversion/ComplexToLLVM/*.h",
6552     ]) + ["lib/Conversion/PassDetail.h"],
6553     hdrs = glob([
6554         "include/mlir/Conversion/ComplexToLLVM/*.h",
6555     ]),
6556     includes = ["include"],
6557     deps = [
6558         ":ComplexDialect",
6559         ":ConversionPassIncGen",
6560         ":IR",
6561         ":LLVMCommonConversion",
6562         ":LLVMDialect",
6563         ":Pass",
6564         ":Support",
6565         ":Transforms",
6566         "//llvm:Core",
6567         "//llvm:Support",
6568     ],
6571 cc_library(
6572     name = "ComplexToStandard",
6573     srcs = glob([
6574         "lib/Conversion/ComplexToStandard/*.cpp",
6575         "lib/Conversion/ComplexToStandard/*.h",
6576     ]) + ["lib/Conversion/PassDetail.h"],
6577     hdrs = glob([
6578         "include/mlir/Conversion/ComplexToStandard/*.h",
6579     ]),
6580     includes = ["include"],
6581     deps = [
6582         ":ComplexDialect",
6583         ":ConversionPassIncGen",
6584         ":IR",
6585         ":MathDialect",
6586         ":Pass",
6587         ":StandardOps",
6588         ":Transforms",
6589     ],
6592 exports_files([
6593     "include/mlir/Interfaces/CallInterfaces.h",
6594     "include/mlir/Interfaces/CastInterfaces.h",
6595     "include/mlir/Interfaces/ControlFlowInterfaces.h",
6596     "include/mlir/Transforms/InliningUtils.h",
6599 td_library(
6600     name = "MathOpsTdFiles",
6601     srcs = [
6602         "include/mlir/Dialect/Math/IR/MathBase.td",
6603         "include/mlir/Dialect/Math/IR/MathOps.td",
6604     ],
6605     includes = ["include"],
6606     deps = [
6607         ":OpBaseTdFiles",
6608         ":SideEffectInterfacesTdFiles",
6609         ":VectorInterfacesTdFiles",
6610     ],
6613 gentbl_cc_library(
6614     name = "MathBaseIncGen",
6615     strip_include_prefix = "include",
6616     tbl_outs = [
6617         (
6618             [
6619                 "-gen-dialect-decls",
6620                 "-dialect=math",
6621             ],
6622             "include/mlir/Dialect/Math/IR/MathOpsDialect.h.inc",
6623         ),
6624         (
6625             [
6626                 "-gen-dialect-defs",
6627                 "-dialect=math",
6628             ],
6629             "include/mlir/Dialect/Math/IR/MathOpsDialect.cpp.inc",
6630         ),
6631     ],
6632     tblgen = ":mlir-tblgen",
6633     td_file = "include/mlir/Dialect/Math/IR/MathBase.td",
6634     deps = [":MathOpsTdFiles"],
6637 gentbl_cc_library(
6638     name = "MathOpsIncGen",
6639     strip_include_prefix = "include",
6640     tbl_outs = [
6641         (
6642             ["-gen-op-decls"],
6643             "include/mlir/Dialect/Math/IR/MathOps.h.inc",
6644         ),
6645         (
6646             ["-gen-op-defs"],
6647             "include/mlir/Dialect/Math/IR/MathOps.cpp.inc",
6648         ),
6649     ],
6650     tblgen = ":mlir-tblgen",
6651     td_file = "include/mlir/Dialect/Math/IR/MathOps.td",
6652     deps = [":MathOpsTdFiles"],
6655 cc_library(
6656     name = "MathDialect",
6657     srcs = glob(
6658         [
6659             "lib/Dialect/Math/IR/*.cpp",
6660             "lib/Dialect/Math/IR/*.h",
6661         ],
6662     ),
6663     hdrs = [
6664         "include/mlir/Dialect/Math/IR/Math.h",
6665         "include/mlir/Transforms/InliningUtils.h",
6666     ],
6667     includes = ["include"],
6668     deps = [
6669         ":IR",
6670         ":MathBaseIncGen",
6671         ":MathOpsIncGen",
6672         ":SideEffectInterfaces",
6673         ":Support",
6674         ":VectorInterfaces",
6675         "//llvm:Support",
6676     ],
6679 cc_library(
6680     name = "MathTransforms",
6681     srcs = glob([
6682         "lib/Dialect/Math/Transforms/*.cpp",
6683         "lib/Dialect/Math/Transforms/*.h",
6684     ]),
6685     hdrs = glob(["include/mlir/Dialect/Math/Transforms/*.h"]),
6686     includes = ["include"],
6687     deps = [
6688         ":IR",
6689         ":MathDialect",
6690         ":Pass",
6691         ":SCFDialect",
6692         ":StandardOps",
6693         ":Support",
6694         ":Transforms",
6695         ":VectorOps",
6696         "//llvm:Support",
6697     ],
6700 cc_library(
6701     name = "MathToLibm",
6702     srcs = glob([
6703         "lib/Conversion/MathToLibm/*.cpp",
6704         "lib/Conversion/MathToLibm/*.h",
6705     ]) + ["lib/Conversion/PassDetail.h"],
6706     hdrs = glob([
6707         "include/mlir/Conversion/MathToLibm/*.h",
6708     ]),
6709     includes = ["include"],
6710     deps = [
6711         ":ConversionPassIncGen",
6712         ":IR",
6713         ":LLVMDialect",
6714         ":MathDialect",
6715         ":Pass",
6716         ":StandardOps",
6717         ":Support",
6718         ":Transforms",
6719         ":VectorOps",
6720         "//llvm:Core",
6721         "//llvm:Support",
6722     ],
6725 td_library(
6726     name = "MemRefOpsTdFiles",
6727     srcs = [
6728         "include/mlir/Dialect/MemRef/IR/MemRefBase.td",
6729         "include/mlir/Dialect/MemRef/IR/MemRefOps.td",
6730     ],
6731     includes = ["include"],
6732     deps = [
6733         ":CastInterfacesTdFiles",
6734         ":ControlFlowInterfacesTdFiles",
6735         ":CopyOpInterfaceTdFiles",
6736         ":OpBaseTdFiles",
6737         ":SideEffectInterfacesTdFiles",
6738         ":ViewLikeInterfaceTdFiles",
6739     ],
6742 gentbl_cc_library(
6743     name = "MemRefBaseIncGen",
6744     strip_include_prefix = "include",
6745     tbl_outs = [
6746         (
6747             [
6748                 "-gen-dialect-decls",
6749                 "-dialect=memref",
6750             ],
6751             "include/mlir/Dialect/MemRef/IR/MemRefOpsDialect.h.inc",
6752         ),
6753         (
6754             [
6755                 "-gen-dialect-defs",
6756                 "-dialect=memref",
6757             ],
6758             "include/mlir/Dialect/MemRef/IR/MemRefOpsDialect.cpp.inc",
6759         ),
6760     ],
6761     tblgen = ":mlir-tblgen",
6762     td_file = "include/mlir/Dialect/MemRef/IR/MemRefBase.td",
6763     deps = [":MemRefOpsTdFiles"],
6766 gentbl_cc_library(
6767     name = "MemRefOpsIncGen",
6768     strip_include_prefix = "include",
6769     tbl_outs = [
6770         (
6771             ["-gen-op-decls"],
6772             "include/mlir/Dialect/MemRef/IR/MemRefOps.h.inc",
6773         ),
6774         (
6775             ["-gen-op-defs"],
6776             "include/mlir/Dialect/MemRef/IR/MemRefOps.cpp.inc",
6777         ),
6778     ],
6779     tblgen = ":mlir-tblgen",
6780     td_file = "include/mlir/Dialect/MemRef/IR/MemRefOps.td",
6781     deps = [":MemRefOpsTdFiles"],
6784 cc_library(
6785     name = "MemRefDialect",
6786     srcs = glob(
6787         [
6788             "lib/Dialect/MemRef/IR/*.cpp",
6789             "lib/Dialect/MemRef/IR/*.h",
6790             "lib/Dialect/MemRef/Utils/*.cpp",
6791         ],
6792     ),
6793     hdrs = [
6794         "include/mlir/Dialect/MemRef/IR/MemRef.h",
6795         "include/mlir/Dialect/MemRef/Utils/MemRefUtils.h",
6796     ],
6797     includes = ["include"],
6798     deps = [
6799         ":ControlFlowInterfaces",
6800         ":CopyOpInterface",
6801         ":DialectUtils",
6802         ":IR",
6803         ":InferTypeOpInterface",
6804         ":MemRefBaseIncGen",
6805         ":MemRefOpsIncGen",
6806         ":StandardOps",
6807         ":TensorDialect",
6808         ":ViewLikeInterface",
6809         "//llvm:Support",
6810     ],
6813 gentbl_cc_library(
6814     name = "MemRefPassIncGen",
6815     strip_include_prefix = "include",
6816     tbl_outs = [
6817         (
6818             [
6819                 "-gen-pass-decls",
6820                 "-name=MemRef",
6821             ],
6822             "include/mlir/Dialect/MemRef/Transforms/Passes.h.inc",
6823         ),
6824     ],
6825     tblgen = ":mlir-tblgen",
6826     td_file = "include/mlir/Dialect/MemRef/Transforms/Passes.td",
6827     deps = [":PassBaseTdFiles"],
6830 cc_library(
6831     name = "MemRefTransforms",
6832     srcs = glob(
6833         [
6834             "lib/Dialect/MemRef/Transforms/*.cpp",
6835             "lib/Dialect/MemRef/Transforms/*.h",
6836         ],
6837     ),
6838     hdrs = glob(["include/mlir/Dialect/MemRef/Transforms/*.h"]),
6839     includes = ["include"],
6840     deps = [
6841         ":Affine",
6842         ":IR",
6843         ":InferTypeOpInterface",
6844         ":MemRefDialect",
6845         ":MemRefPassIncGen",
6846         ":Pass",
6847         ":StandardOps",
6848         ":Support",
6849         ":TensorDialect",
6850         ":Transforms",
6851         ":VectorOps",
6852         "//llvm:Support",
6853     ],
6856 td_library(
6857     name = "DLTIDialectTdFiles",
6858     srcs = [
6859         "include/mlir/Dialect/DLTI/DLTI.td",
6860         "include/mlir/Dialect/DLTI/DLTIBase.td",
6861     ],
6862     includes = ["include"],
6863     deps = [":OpBaseTdFiles"],
6866 gentbl_cc_library(
6867     name = "DLTIBaseIncGen",
6868     strip_include_prefix = "include",
6869     tbl_outs = [
6870         (
6871             [
6872                 "-gen-dialect-decls",
6873                 "-dialect=dlti",
6874             ],
6875             "include/mlir/Dialect/DLTI/DLTIDialect.h.inc",
6876         ),
6877         (
6878             [
6879                 "-gen-dialect-defs",
6880                 "-dialect=dlti",
6881             ],
6882             "include/mlir/Dialect/DLTI/DLTIDialect.cpp.inc",
6883         ),
6884     ],
6885     tblgen = ":mlir-tblgen",
6886     td_file = "include/mlir/Dialect/DLTI/DLTIBase.td",
6887     deps = [":OpBaseTdFiles"],
6890 cc_library(
6891     name = "DLTIDialect",
6892     srcs = glob(["lib/Dialect/DLTI/*.cpp"]),
6893     hdrs = glob(["include/mlir/Dialect/DLTI/*.h"]),
6894     includes = ["include"],
6895     deps = [
6896         ":DLTIBaseIncGen",
6897         ":DataLayoutInterfaces",
6898         ":IR",
6899         "//llvm:Support",
6900     ],
6903 gentbl_cc_library(
6904     name = "ReducerIncGen",
6905     strip_include_prefix = "include",
6906     tbl_outs = [
6907         (
6908             [
6909                 "-gen-pass-decls",
6910                 "-name=Reducer",
6911             ],
6912             "include/mlir/Reducer/Passes.h.inc",
6913         ),
6914     ],
6915     tblgen = ":mlir-tblgen",
6916     td_file = "include/mlir/Reducer/Passes.td",
6917     deps = [
6918         ":PassBaseTdFiles",
6919         ":ReducerTdFiles",
6920     ],
6923 cc_library(
6924     name = "Reducer",
6925     srcs = glob(["lib/Reducer/*.cpp"]),
6926     hdrs = glob(["include/mlir/Reducer/*.h"]),
6927     includes = ["include"],
6928     deps = [
6929         ":IR",
6930         ":Pass",
6931         ":ReducerIncGen",
6932         ":Rewrite",
6933         ":Support",
6934         ":TransformUtils",
6935         "//llvm:Support",
6936     ],
6939 cc_library(
6940     name = "MlirReduceLib",
6941     srcs = ["lib/Tools/mlir-reduce/MlirReduceMain.cpp"],
6942     hdrs = ["include/mlir/Tools/mlir-reduce/MlirReduceMain.h"],
6943     includes = ["include"],
6944     deps = [
6945         ":IR",
6946         ":Parser",
6947         ":Pass",
6948         ":Reducer",
6949         ":Rewrite",
6950         ":Support",
6951         "//llvm:Support",
6952     ],
6955 cc_binary(
6956     name = "mlir-reduce",
6957     srcs = ["tools/mlir-reduce/mlir-reduce.cpp"],
6958     includes = ["include"],
6959     local_defines = ["MLIR_INCLUDE_TESTS"],
6960     stamp = 0,
6961     deps = [
6962         ":AllPassesAndDialects",
6963         ":IR",
6964         ":MlirReduceLib",
6965         ":Pass",
6966         "//llvm:Support",
6967         "//mlir/test:TestDialect",
6968     ],