[AMDGPU] Make v8i16/v8f16 legal
[llvm-project.git] / utils / bazel / llvm-project-overlay / mlir / unittests / BUILD.bazel
blob9092d53e9fe2b5b0efd64c51c0908ecb9a20035d
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")
7 package(
8     default_visibility = ["//visibility:public"],
9     licenses = ["notice"],
12 cc_test(
13     name = "ir_tests",
14     size = "small",
15     srcs = glob([
16         "IR/*.cpp",
17         "IR/*.h",
18     ]),
19     deps = [
20         "//llvm:TestingSupport",
21         "//llvm:gtest_main",
22         "//mlir:IR",
23         "//mlir/test:TestDialect",
24     ],
27 cc_test(
28     name = "interface_tests",
29     size = "small",
30     srcs = glob([
31         "Interfaces/*.cpp",
32         "Interfaces/*.h",
33     ]),
34     deps = [
35         "//llvm:TestingSupport",
36         "//llvm:gtest_main",
37         "//mlir:ControlFlowInterfaces",
38         "//mlir:DLTIDialect",
39         "//mlir:DataLayoutInterfaces",
40         "//mlir:IR",
41         "//mlir:InferTypeOpInterface",
42         "//mlir:Parser",
43         "//mlir:StandardOps",
44     ],
47 cc_test(
48     name = "support_tests",
49     size = "small",
50     srcs = glob([
51         "Support/*.cpp",
52         "Support/*.h",
53     ]),
54     deps = [
55         "//llvm:Support",
56         "//llvm:TestingSupport",
57         "//llvm:gtest_main",
58         "//mlir:Support",
59     ],
62 cc_test(
63     name = "pass_tests",
64     size = "small",
65     srcs = glob([
66         "Pass/*.cpp",
67         "Pass/*.h",
68     ]),
69     deps = [
70         "//llvm:TestingSupport",
71         "//llvm:gtest_main",
72         "//mlir:Analysis",
73         "//mlir:IR",
74         "//mlir:Pass",
75     ],
78 cc_test(
79     name = "rewrite_tests",
80     size = "small",
81     srcs = glob([
82         "Rewrite/*.cpp",
83         "Rewrite/*.h",
84     ]),
85     deps = [
86         "//llvm:gtest_main",
87         "//mlir:IR",
88         "//mlir:Rewrite",
89     ],
92 cc_test(
93     name = "dialect_tests",
94     size = "small",
95     srcs = glob([
96         "Dialect/*.cpp",
97         "Dialect/*.h",
98     ]),
99     deps = [
100         "//llvm:TestingSupport",
101         "//llvm:gtest_main",
102         "//mlir:Dialect",
103     ],
106 cc_test(
107     name = "quantops_tests",
108     size = "small",
109     srcs = glob([
110         "Dialect/Quant/*.cpp",
111         "Dialect/Quant/*.h",
112     ]),
113     deps = [
114         "//llvm:TestingSupport",
115         "//llvm:gtest_main",
116         "//mlir:QuantOps",
117         "//mlir:Transforms",
118     ],
121 cc_test(
122     name = "scf_tests",
123     size = "small",
124     srcs = glob([
125         "Dialect/SCF/*.cpp",
126         "Dialect/SCF/*.h",
127     ]),
128     deps = [
129         "//llvm:gtest_main",
130         "//mlir:Parser",
131         "//mlir:SCFDialect",
132         "//mlir:StandardOps",
133     ],
136 cc_test(
137     name = "sparse_tensor_tests",
138     size = "small",
139     srcs = glob([
140         "Dialect/SparseTensor/*.cpp",
141         "Dialect/SparseTensor/*.h",
142     ]),
143     deps = [
144         "//llvm:TestingSupport",
145         "//llvm:gtest_main",
146         "//mlir:SparseTensorUtils",
147     ],
150 cc_test(
151     name = "spirv_tests",
152     size = "small",
153     srcs = glob([
154         "Dialect/SPIRV/*.cpp",
155         "Dialect/SPIRV/*.h",
156     ]),
157     deps = [
158         "//llvm:TestingSupport",
159         "//llvm:gtest_main",
160         "//mlir:SPIRVDeserialization",
161         "//mlir:SPIRVDialect",
162         "//mlir:SPIRVSerialization",
163     ],
166 cc_test(
167     name = "dialect_utils_tests",
168     size = "small",
169     srcs = glob([
170         "Dialect/Utils/*.cpp",
171         "Dialect/Utils/*.h",
172     ]),
173     deps = [
174         "//llvm:TestingSupport",
175         "//llvm:gtest_main",
176         "//mlir:DialectUtils",
177     ],
180 gentbl_cc_library(
181     name = "EnumsIncGen",
182     tbl_outs = [
183         (
184             ["-gen-enum-decls"],
185             "TableGen/EnumsGenTest.h.inc",
186         ),
187         (
188             ["-gen-enum-defs"],
189             "TableGen/EnumsGenTest.cpp.inc",
190         ),
191     ],
192     tblgen = "//mlir:mlir-tblgen",
193     td_file = "TableGen/enums.td",
194     deps = [
195         "//mlir:OpBaseTdFiles",
196     ],
199 gentbl_cc_library(
200     name = "PassIncGen",
201     tbl_outs = [
202         (
203             ["-gen-pass-decls"],
204             "TableGen/PassGenTest.h.inc",
205         ),
206     ],
207     tblgen = "//mlir:mlir-tblgen",
208     td_file = "TableGen/passes.td",
209     deps = [
210         "//mlir:PassBaseTdFiles",
211         "//mlir:RewritePassBaseTdFiles",
212     ],
215 gentbl_cc_library(
216     name = "StructsIncGen",
217     tbl_outs = [
218         (
219             ["-gen-struct-attr-decls"],
220             "TableGen/StructAttrGenTest.h.inc",
221         ),
222         (
223             ["-gen-struct-attr-defs"],
224             "TableGen/StructAttrGenTest.cpp.inc",
225         ),
226     ],
227     tblgen = "//mlir:mlir-tblgen",
228     td_file = "TableGen/structs.td",
229     deps = [
230         "//mlir:OpBaseTdFiles",
231     ],
234 cc_test(
235     name = "tablegen_tests",
236     size = "small",
237     srcs = glob([
238         "TableGen/*.cpp",
239         "TableGen/*.h",
240     ]) + [
241         "TableGen/EnumsGenTest.cpp.inc",
242         "TableGen/EnumsGenTest.h.inc",
243         "TableGen/StructAttrGenTest.cpp.inc",
244         "TableGen/StructAttrGenTest.h.inc",
245     ],
246     includes = ["TableGen/"],
247     deps = [
248         ":EnumsIncGen",
249         ":PassIncGen",
250         ":StructsIncGen",
251         "//llvm:Support",
252         "//llvm:TestingSupport",
253         "//llvm:gtest_main",
254         "//mlir:IR",
255         "//mlir:TableGen",
256         "//mlir/test:TestDialect",
257     ],
260 cc_test(
261     name = "transforms_test",
262     size = "small",
263     srcs = glob([
264         "Transforms/*.cpp",
265         "Transforms/*.h",
266     ]),
267     deps = [
268         "//llvm:gtest_main",
269         "//mlir:AffineAnalysis",
270         "//mlir:IR",
271         "//mlir:Parser",
272         "//mlir:Pass",
273         "//mlir:TransformUtils",
274         "//mlir:Transforms",
275     ],
278 cc_test(
279     name = "analysis_tests",
280     size = "small",
281     srcs = glob([
282         "Analysis/*.cpp",
283         "Analysis/*.h",
284         "Analysis/*/*.cpp",
285         "Analysis/*/*.h",
286         "Dialect/Affine/Analysis/AffineStructuresParser.*",
287     ]),
288     deps = [
289         "//llvm:TestingSupport",
290         "//llvm:gtest_main",
291         "//mlir:AffineAnalysis",
292         "//mlir:Analysis",
293         "//mlir:IR",
294     ],
297 cc_test(
298     name = "conversion_tests",
299     size = "small",
300     srcs = glob([
301         "Conversion/*.cpp",
302         "Conversion/*.h",
303         "Conversion/*/*.cpp",
304         "Conversion/*/*.h",
305     ]),
306     deps = [
307         "//llvm:gtest_main",
308         "//mlir:ArithmeticDialect",
309         "//mlir:PDLToPDLInterp",
310     ],
313 cc_test(
314     name = "execution_engine_tests",
315     size = "small",
316     srcs = glob([
317         "ExecutionEngine/*.cpp",
318     ]),
319     tags = [
320         # MSAN does not work with JIT.
321         "nomsan",
322     ],
323     deps = [
324         "//llvm:TestingSupport",
325         "//llvm:gtest_main",
326         "//mlir:AllPassesAndDialects",
327         "//mlir:Analysis",
328         "//mlir:ExecutionEngine",
329         "//mlir:IR",
330         "//mlir:LinalgToLLVM",
331         "//mlir:MemRefToLLVM",
332         "//mlir:mlir_c_runner_utils",
333         "//mlir:mlir_runner_utils",
334     ],