[AMDGPU] Make v8i16/v8f16 legal
[llvm-project.git] / utils / bazel / llvm-project-overlay / mlir / test / BUILD.bazel
blob7bc92df875c46406fe08a896cbd392f377566098
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
7 package(
8     default_visibility = ["//visibility:public"],
9     licenses = ["notice"],
12 cc_library(
13     name = "IRProducingAPITest",
14     hdrs = ["APITest.h"],
15     includes = ["."],
18 cc_library(
19     name = "TestAnalysis",
20     srcs = glob(["lib/Analysis/*.cpp"]),
21     includes = ["lib/Dialect/Test"],
22     deps = [
23         ":TestDialect",
24         "//llvm:Support",
25         "//mlir:Affine",
26         "//mlir:AffineAnalysis",
27         "//mlir:Analysis",
28         "//mlir:IR",
29         "//mlir:MemRefDialect",
30         "//mlir:Pass",
31         "//mlir:Support",
32     ],
35 td_library(
36     name = "TestOpTdFiles",
37     srcs = glob(["lib/Dialect/Test/*.td"]),
38     deps = [
39         "//mlir:BuiltinDialectTdFiles",
40         "//mlir:CallInterfacesTdFiles",
41         "//mlir:ControlFlowInterfacesTdFiles",
42         "//mlir:CopyOpInterfaceTdFiles",
43         "//mlir:DLTIDialectTdFiles",
44         "//mlir:DataLayoutInterfacesTdFiles",
45         "//mlir:InferTypeOpInterfaceTdFiles",
46         "//mlir:LinalgStructuredOpsTdFiles",
47         "//mlir:OpBaseTdFiles",
48         "//mlir:SideEffectTdFiles",
49     ],
52 gentbl_cc_library(
53     name = "TestOpsIncGen",
54     strip_include_prefix = "lib/Dialect/Test",
55     tbl_outs = [
56         (
57             ["-gen-op-decls"],
58             "lib/Dialect/Test/TestOps.h.inc",
59         ),
60         (
61             ["-gen-op-defs"],
62             "lib/Dialect/Test/TestOps.cpp.inc",
63         ),
64         (
65             [
66                 "-gen-dialect-decls",
67                 "-dialect=test",
68             ],
69             "lib/Dialect/Test/TestOpsDialect.h.inc",
70         ),
71         (
72             [
73                 "-gen-dialect-defs",
74                 "-dialect=test",
75             ],
76             "lib/Dialect/Test/TestOpsDialect.cpp.inc",
77         ),
78         (
79             ["-gen-enum-decls"],
80             "lib/Dialect/Test/TestOpEnums.h.inc",
81         ),
82         (
83             ["-gen-enum-defs"],
84             "lib/Dialect/Test/TestOpEnums.cpp.inc",
85         ),
86         (
87             ["-gen-struct-attr-decls"],
88             "lib/Dialect/Test/TestOpStructs.h.inc",
89         ),
90         (
91             ["-gen-struct-attr-defs"],
92             "lib/Dialect/Test/TestOpStructs.cpp.inc",
93         ),
94         (
95             ["-gen-rewriters"],
96             "lib/Dialect/Test/TestPatterns.inc",
97         ),
98     ],
99     tblgen = "//mlir:mlir-tblgen",
100     td_file = "lib/Dialect/Test/TestOps.td",
101     test = True,
102     deps = [
103         ":TestOpTdFiles",
104     ],
107 gentbl_cc_library(
108     name = "TestInterfacesIncGen",
109     strip_include_prefix = "lib/Dialect/Test",
110     tbl_outs = [
111         (
112             ["-gen-attr-interface-decls"],
113             "lib/Dialect/Test/TestAttrInterfaces.h.inc",
114         ),
115         (
116             ["-gen-attr-interface-defs"],
117             "lib/Dialect/Test/TestAttrInterfaces.cpp.inc",
118         ),
119         (
120             ["-gen-type-interface-decls"],
121             "lib/Dialect/Test/TestTypeInterfaces.h.inc",
122         ),
123         (
124             ["-gen-type-interface-defs"],
125             "lib/Dialect/Test/TestTypeInterfaces.cpp.inc",
126         ),
127         (
128             ["-gen-op-interface-decls"],
129             "lib/Dialect/Test/TestOpInterfaces.h.inc",
130         ),
131         (
132             ["-gen-op-interface-defs"],
133             "lib/Dialect/Test/TestOpInterfaces.cpp.inc",
134         ),
135     ],
136     tblgen = "//mlir:mlir-tblgen",
137     td_file = "lib/Dialect/Test/TestInterfaces.td",
138     test = True,
139     deps = [
140         "//mlir:OpBaseTdFiles",
141         "//mlir:SideEffectInterfacesTdFiles",
142     ],
145 gentbl_cc_library(
146     name = "TestAttrDefsIncGen",
147     strip_include_prefix = "lib/Dialect/Test",
148     tbl_outs = [
149         (
150             ["-gen-attrdef-decls"],
151             "lib/Dialect/Test/TestAttrDefs.h.inc",
152         ),
153         (
154             ["-gen-attrdef-defs"],
155             "lib/Dialect/Test/TestAttrDefs.cpp.inc",
156         ),
157     ],
158     tblgen = "//mlir:mlir-tblgen",
159     td_file = "lib/Dialect/Test/TestOps.td",
160     test = True,
161     deps = [
162         ":TestOpTdFiles",
163     ],
166 gentbl_cc_library(
167     name = "TestTypeDefsIncGen",
168     strip_include_prefix = "lib/Dialect/Test",
169     tbl_outs = [
170         (
171             [
172                 "-gen-typedef-decls",
173                 "--typedefs-dialect=test",
174             ],
175             "lib/Dialect/Test/TestTypeDefs.h.inc",
176         ),
177         (
178             [
179                 "-gen-typedef-defs",
180                 "--typedefs-dialect=test",
181             ],
182             "lib/Dialect/Test/TestTypeDefs.cpp.inc",
183         ),
184     ],
185     tblgen = "//mlir:mlir-tblgen",
186     td_file = "lib/Dialect/Test/TestTypeDefs.td",
187     test = True,
188     deps = [
189         ":TestOpTdFiles",
190         "//mlir:BuiltinDialectTdFiles",
191     ],
194 cc_library(
195     name = "TestDialect",
196     srcs = glob(["lib/Dialect/Test/*.cpp"]),
197     hdrs = glob(["lib/Dialect/Test/*.h"]),
198     includes = [
199         "lib/Dialect/Test",
200     ],
201     deps = [
202         ":TestAttrDefsIncGen",
203         ":TestInterfacesIncGen",
204         ":TestOpsIncGen",
205         ":TestTypeDefsIncGen",
206         "//llvm:Support",
207         "//mlir:ArithmeticDialect",
208         "//mlir:ControlFlowInterfaces",
209         "//mlir:CopyOpInterface",
210         "//mlir:DLTIDialect",
211         "//mlir:DataLayoutInterfaces",
212         "//mlir:DerivedAttributeOpInterface",
213         "//mlir:Dialect",
214         "//mlir:IR",
215         "//mlir:InferTypeOpInterface",
216         "//mlir:LLVMDialect",
217         "//mlir:LinalgInterfaces",
218         "//mlir:LinalgOps",
219         "//mlir:Pass",
220         "//mlir:Reducer",
221         "//mlir:SideEffects",
222         "//mlir:StandardOps",
223         "//mlir:StandardOpsTransforms",
224         "//mlir:Support",
225         "//mlir:TensorDialect",
226         "//mlir:TransformUtils",
227         "//mlir:Transforms",
228     ],
231 cc_library(
232     name = "TestIR",
233     srcs = glob(["lib/IR/*.cpp"]),
234     deps = [
235         ":TestDialect",
236         "//llvm:Support",
237         "//mlir:Analysis",
238         "//mlir:IR",
239         "//mlir:LinalgOps",
240         "//mlir:Pass",
241         "//mlir:StandardOps",
242         "//mlir:Support",
243     ],
246 cc_library(
247     name = "TestPass",
248     srcs = glob(["lib/Pass/*.cpp"]),
249     deps = [
250         "//llvm:Support",
251         "//mlir:IR",
252         "//mlir:Pass",
253         "//mlir:Support",
254     ],
257 cc_library(
258     name = "TestRewrite",
259     srcs = [
260         "lib/Rewrite/TestPDLByteCode.cpp",
261     ],
262     deps = [
263         "//mlir:IR",
264         "//mlir:PDLInterpDialect",
265         "//mlir:Pass",
266         "//mlir:Support",
267         "//mlir:TransformUtils",
268     ],
271 cc_library(
272     name = "TestReducer",
273     srcs = [
274         "lib/Reducer/MLIRTestReducer.cpp",
275     ],
276     deps = [
277         "//mlir:IR",
278         "//mlir:Pass",
279         "//mlir:Support",
280     ],
283 cc_library(
284     name = "TestTransforms",
285     srcs = glob(["lib/Transforms/*.cpp"]),
286     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
287     includes = ["lib/Dialect/Test"],
288     deps = [
289         ":TestDialect",
290         "//llvm:Support",
291         "//mlir:Affine",
292         "//mlir:AffineAnalysis",
293         "//mlir:Analysis",
294         "//mlir:ArithmeticDialect",
295         "//mlir:IR",
296         "//mlir:MathDialect",
297         "//mlir:Pass",
298         "//mlir:SCFDialect",
299         "//mlir:SPIRVDialect",
300         "//mlir:StandardOps",
301         "//mlir:TransformUtils",
302     ],
305 cc_library(
306     name = "TestStandardToLLVM",
307     srcs = glob(["lib/Conversion/StandardToLLVM/*.cpp"]),
308     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
309     includes = ["lib/Dialect/Test"],
310     deps = [
311         ":TestDialect",
312         "//mlir:LLVMCommonConversion",
313         "//mlir:LLVMDialect",
314         "//mlir:Pass",
315         "//mlir:StandardOps",
316         "//mlir:StandardToLLVM",
317     ],
320 cc_library(
321     name = "TestAffine",
322     srcs = glob([
323         "lib/Dialect/Affine/*.cpp",
324     ]),
325     deps = [
326         "//llvm:Support",
327         "//mlir:Affine",
328         "//mlir:AffineAnalysis",
329         "//mlir:AffineTransforms",
330         "//mlir:AffineUtils",
331         "//mlir:Analysis",
332         "//mlir:IR",
333         "//mlir:MemRefDialect",
334         "//mlir:Pass",
335         "//mlir:Support",
336         "//mlir:Transforms",
337         "//mlir:VectorOps",
338     ],
341 cc_library(
342     name = "TestDLTI",
343     srcs = glob(["lib/Dialect/DLTI/*.cpp"]),
344     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
345     includes = ["lib/Dialect/Test"],
346     deps = [
347         ":TestDialect",
348         "//mlir:Analysis",
349         "//mlir:DLTIDialect",
350         "//mlir:IR",
351         "//mlir:Pass",
352     ],
355 cc_library(
356     name = "TestGPU",
357     srcs = glob(["lib/Dialect/GPU/*.cpp"]),
358     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
359     includes = ["lib/Dialect/Test"],
360     deps = [
361         "//llvm:NVPTXCodeGen",
362         "//llvm:Support",
363         "//mlir:Affine",
364         "//mlir:ArithmeticDialect",
365         "//mlir:GPUDialect",
366         "//mlir:GPUTransforms",
367         "//mlir:IR",
368         "//mlir:MemRefDialect",
369         "//mlir:NVVMToLLVMIRTranslation",
370         "//mlir:Pass",
371         "//mlir:ROCDLToLLVMIRTranslation",
372         "//mlir:SCFDialect",
373         "//mlir:SPIRVDialect",
374         "//mlir:StandardOps",
375         "//mlir:ToLLVMIRTranslation",
376         "//mlir:TransformUtils",
377     ],
380 cc_library(
381     name = "TestLinalg",
382     srcs = glob(["lib/Dialect/Linalg/*.cpp"]),
383     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
384     includes = ["lib/Dialect/Test"],
385     deps = [
386         "//llvm:Support",
387         "//mlir:Affine",
388         "//mlir:AffineBufferizableOpInterfaceImpl",
389         "//mlir:ArithBufferizableOpInterfaceImpl",
390         "//mlir:ArithmeticDialect",
391         "//mlir:BufferizationDialect",
392         "//mlir:BufferizationTransforms",
393         "//mlir:GPUDialect",
394         "//mlir:IR",
395         "//mlir:LinalgBufferizableOpInterfaceImpl",
396         "//mlir:LinalgOps",
397         "//mlir:LinalgTransforms",
398         "//mlir:MemRefDialect",
399         "//mlir:Pass",
400         "//mlir:SCFBufferizableOpInterfaceImpl",
401         "//mlir:SCFDialect",
402         "//mlir:SCFTransforms",
403         "//mlir:StandardOps",
404         "//mlir:StdBufferizableOpInterfaceImpl",
405         "//mlir:TensorDialect",
406         "//mlir:TensorTransforms",
407         "//mlir:TransformUtils",
408         "//mlir:VectorBufferizableOpInterfaceImpl",
409         "//mlir:VectorOps",
410         "//mlir:VectorToSCF",
411     ],
414 cc_library(
415     name = "TestMath",
416     srcs = glob(["lib/Dialect/Math/*.cpp"]),
417     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
418     includes = ["lib/Dialect/Test"],
419     deps = [
420         "//mlir:ArithmeticDialect",
421         "//mlir:MathDialect",
422         "//mlir:MathTransforms",
423         "//mlir:Pass",
424         "//mlir:TransformUtils",
425         "//mlir:VectorOps",
426         "//mlir:X86Vector",
427     ],
430 cc_library(
431     name = "TestSCF",
432     srcs = glob(["lib/Dialect/SCF/*.cpp"]),
433     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
434     includes = ["lib/Dialect/Test"],
435     deps = [
436         "//llvm:Support",
437         "//mlir:ArithmeticDialect",
438         "//mlir:IR",
439         "//mlir:MathDialect",
440         "//mlir:Pass",
441         "//mlir:SCFDialect",
442         "//mlir:SCFTransforms",
443         "//mlir:StandardOps",
444         "//mlir:TransformUtils",
445     ],
448 cc_library(
449     name = "TestShapeDialect",
450     srcs = [
451         "lib/Dialect/Shape/TestShapeFunctions.cpp",
452     ],
453     deps = [
454         "//llvm:Support",
455         "//mlir:IR",
456         "//mlir:InferTypeOpInterface",
457         "//mlir:Pass",
458         "//mlir:Shape",
459     ],
462 cc_library(
463     name = "TestSPIRV",
464     srcs = glob([
465         "lib/Dialect/SPIRV/*.cpp",
466     ]),
467     deps = [
468         "//mlir:GPUDialect",
469         "//mlir:IR",
470         "//mlir:Pass",
471         "//mlir:SPIRVConversion",
472         "//mlir:SPIRVDialect",
473         "//mlir:SPIRVModuleCombiner",
474         "//mlir:Transforms",
475     ],
478 cc_library(
479     name = "TestStandardOps",
480     srcs = glob(["lib/Dialect/StandardOps/*.cpp"]),
481     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
482     includes = ["lib/Dialect/Test"],
483     deps = [
484         ":TestDialect",
485         "//mlir:Affine",
486         "//mlir:IR",
487         "//mlir:Pass",
488         "//mlir:StandardOps",
489         "//mlir:StandardOpsTransforms",
490         "//mlir:TransformUtils",
491     ],
494 cc_library(
495     name = "TestVector",
496     srcs = glob(["lib/Dialect/Vector/*.cpp"]),
497     defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
498     includes = ["lib/Dialect/Test"],
499     deps = [
500         "//mlir:Affine",
501         "//mlir:Analysis",
502         "//mlir:LLVMDialect",
503         "//mlir:LinalgOps",
504         "//mlir:LinalgTransforms",
505         "//mlir:MemRefDialect",
506         "//mlir:Pass",
507         "//mlir:SCFDialect",
508         "//mlir:StandardOps",
509         "//mlir:TransformUtils",
510         "//mlir:VectorOps",
511         "//mlir:VectorToSCF",
512         "//mlir:X86Vector",
513     ],
516 cc_library(
517     name = "TestTypeDialect",
518     srcs = glob([
519         "lib/Dialect/LLVMIR/*.cpp",
520     ]),
521     deps = [
522         ":TestDialect",
523         "//mlir:IR",
524         "//mlir:LLVMDialect",
525     ],
528 cc_library(
529     name = "TestTosaDialect",
530     srcs = glob([
531         "lib/Dialect/Tosa/*.cpp",
532     ]),
533     deps = [
534         "//mlir:IR",
535         "//mlir:Pass",
536         "//mlir:StandardOps",
537         "//mlir:TensorDialect",
538         "//mlir:TosaDialect",
539         "//mlir:Transforms",
540     ],