| 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 |
| 4 |
|
| 5 |
load("//mlir:tblgen.bzl", "gentbl_cc_library") |
| 6 |
|
| 7 |
package( |
| 8 |
default_visibility = ["//visibility:public"], |
| 9 |
features = ["layering_check"], |
| 10 |
) |
| 11 |
|
| 12 |
licenses(["notice"]) |
| 13 |
|
| 14 |
cc_test( |
| 15 |
name = "debug_tests", |
| 16 |
size = "small", |
| 17 |
srcs = glob([ |
| 18 |
"Debug/*.cpp", |
| 19 |
]), |
| 20 |
deps = [ |
| 21 |
"//llvm:Support", |
| 22 |
"//llvm:TestingSupport", |
| 23 |
"//mlir:Debug", |
| 24 |
"//mlir:IR", |
| 25 |
"//mlir:Support", |
| 26 |
"//third-party/unittest:gmock", |
| 27 |
"//third-party/unittest:gtest", |
| 28 |
"//third-party/unittest:gtest_main", |
| 29 |
], |
| 30 |
) |
| 31 |
|
| 32 |
cc_test( |
| 33 |
name = "ir_tests", |
| 34 |
size = "small", |
| 35 |
srcs = glob([ |
| 36 |
"IR/*.cpp", |
| 37 |
]), |
| 38 |
deps = [ |
| 39 |
"//llvm:Support", |
| 40 |
"//mlir:BytecodeReader", |
| 41 |
"//mlir:CallOpInterfaces", |
| 42 |
"//mlir:FunctionInterfaces", |
| 43 |
"//mlir:IR", |
| 44 |
"//mlir:MemRefDialect", |
| 45 |
"//mlir:Parser", |
| 46 |
"//mlir:Support", |
| 47 |
"//mlir/test:TestDialect", |
| 48 |
"//third-party/unittest:gmock", |
| 49 |
"//third-party/unittest:gtest", |
| 50 |
"//third-party/unittest:gtest_main", |
| 51 |
], |
| 52 |
) |
| 53 |
|
| 54 |
cc_test( |
| 55 |
name = "interface_tests", |
| 56 |
size = "small", |
| 57 |
srcs = glob([ |
| 58 |
"Interfaces/*.cpp", |
| 59 |
]), |
| 60 |
deps = [ |
| 61 |
"//llvm:Support", |
| 62 |
"//llvm:TestingSupport", |
| 63 |
"//mlir:ArithDialect", |
| 64 |
"//mlir:BytecodeReader", |
| 65 |
"//mlir:ControlFlowInterfaces", |
| 66 |
"//mlir:DLTIDialect", |
| 67 |
"//mlir:DataLayoutInterfaces", |
| 68 |
"//mlir:FuncDialect", |
| 69 |
"//mlir:IR", |
| 70 |
"//mlir:InferIntRangeInterface", |
| 71 |
"//mlir:InferTypeOpInterface", |
| 72 |
"//mlir:Parser", |
| 73 |
"//third-party/unittest:gtest", |
| 74 |
"//third-party/unittest:gtest_main", |
| 75 |
], |
| 76 |
) |
| 77 |
|
| 78 |
cc_test( |
| 79 |
name = "support_tests", |
| 80 |
size = "small", |
| 81 |
srcs = glob([ |
| 82 |
"Support/*.cpp", |
| 83 |
]), |
| 84 |
deps = [ |
| 85 |
"//llvm:Support", |
| 86 |
"//llvm:TestingSupport", |
| 87 |
"//mlir:Support", |
| 88 |
"//third-party/unittest:gmock", |
| 89 |
"//third-party/unittest:gtest_main", |
| 90 |
], |
| 91 |
) |
| 92 |
|
| 93 |
cc_test( |
| 94 |
name = "pass_tests", |
| 95 |
size = "small", |
| 96 |
srcs = glob([ |
| 97 |
"Pass/*.cpp", |
| 98 |
]), |
| 99 |
deps = [ |
| 100 |
"//llvm:Support", |
| 101 |
"//llvm:TestingSupport", |
| 102 |
"//mlir:Analysis", |
| 103 |
"//mlir:Debug", |
| 104 |
"//mlir:FuncDialect", |
| 105 |
"//mlir:IR", |
| 106 |
"//mlir:Pass", |
| 107 |
"//third-party/unittest:gtest", |
| 108 |
"//third-party/unittest:gtest_main", |
| 109 |
], |
| 110 |
) |
| 111 |
|
| 112 |
cc_test( |
| 113 |
name = "rewrite_tests", |
| 114 |
size = "small", |
| 115 |
srcs = glob([ |
| 116 |
"Rewrite/*.cpp", |
| 117 |
]), |
| 118 |
deps = [ |
| 119 |
"//mlir:IR", |
| 120 |
"//mlir:Rewrite", |
| 121 |
"//mlir:SideEffectInterfaces", |
| 122 |
"//third-party/unittest:gtest", |
| 123 |
"//third-party/unittest:gtest_main", |
| 124 |
], |
| 125 |
) |
| 126 |
|
| 127 |
cc_test( |
| 128 |
name = "dialect_tests", |
| 129 |
size = "small", |
| 130 |
srcs = glob([ |
| 131 |
"Dialect/*.cpp", |
| 132 |
]), |
| 133 |
deps = [ |
| 134 |
"//llvm:Support", |
| 135 |
"//mlir:Dialect", |
| 136 |
"//third-party/unittest:gmock", |
| 137 |
"//third-party/unittest:gtest_main", |
| 138 |
], |
| 139 |
) |
| 140 |
|
| 141 |
cc_test( |
| 142 |
name = "amdgpu_tests", |
| 143 |
size = "small", |
| 144 |
srcs = glob([ |
| 145 |
"Dialect/AMDGPU/*.cpp", |
| 146 |
]), |
| 147 |
deps = [ |
| 148 |
"//mlir:AMDGPUUtils", |
| 149 |
"//third-party/unittest:gtest", |
| 150 |
"//third-party/unittest:gtest_main", |
| 151 |
], |
| 152 |
) |
| 153 |
|
| 154 |
cc_test( |
| 155 |
name = "memref_tests", |
| 156 |
size = "small", |
| 157 |
srcs = glob([ |
| 158 |
"Dialect/MemRef/*.cpp", |
| 159 |
]), |
| 160 |
deps = [ |
| 161 |
"//llvm:TestingSupport", |
| 162 |
"//mlir:IR", |
| 163 |
"//mlir:MemRefDialect", |
| 164 |
"//mlir:SideEffectInterfaces", |
| 165 |
"//third-party/unittest:gtest", |
| 166 |
"//third-party/unittest:gtest_main", |
| 167 |
], |
| 168 |
) |
| 169 |
|
| 170 |
cc_test( |
| 171 |
name = "scf_tests", |
| 172 |
size = "small", |
| 173 |
srcs = glob([ |
| 174 |
"Dialect/SCF/*.cpp", |
| 175 |
]), |
| 176 |
deps = [ |
| 177 |
"//mlir:AffineDialect", |
| 178 |
"//mlir:ArithDialect", |
| 179 |
"//mlir:DialectUtils", |
| 180 |
"//mlir:FuncDialect", |
| 181 |
"//mlir:IR", |
| 182 |
"//mlir:LoopLikeInterface", |
| 183 |
"//mlir:Parser", |
| 184 |
"//mlir:SCFDialect", |
| 185 |
"//mlir:SCFUtils", |
| 186 |
"//mlir:SideEffectInterfaces", |
| 187 |
"//third-party/unittest:gtest", |
| 188 |
"//third-party/unittest:gtest_main", |
| 189 |
], |
| 190 |
) |
| 191 |
|
| 192 |
cc_test( |
| 193 |
name = "sparse_tensor_tests", |
| 194 |
size = "small", |
| 195 |
srcs = glob([ |
| 196 |
"Dialect/SparseTensor/*.cpp", |
| 197 |
]), |
| 198 |
deps = [ |
| 199 |
"//llvm:Support", |
| 200 |
"//llvm:TestingSupport", |
| 201 |
"//mlir:SideEffectInterfaces", |
| 202 |
"//mlir:SparseTensorUtils", |
| 203 |
"//third-party/unittest:gmock", |
| 204 |
"//third-party/unittest:gtest", |
| 205 |
"//third-party/unittest:gtest_main", |
| 206 |
], |
| 207 |
) |
| 208 |
|
| 209 |
cc_test( |
| 210 |
name = "spirv_tests", |
| 211 |
size = "small", |
| 212 |
srcs = glob([ |
| 213 |
"Dialect/SPIRV/*.cpp", |
| 214 |
]), |
| 215 |
deps = [ |
| 216 |
"//llvm:Support", |
| 217 |
"//llvm:TestingSupport", |
| 218 |
"//mlir:IR", |
| 219 |
"//mlir:SPIRVBinaryUtils", |
| 220 |
"//mlir:SPIRVDeserialization", |
| 221 |
"//mlir:SPIRVDialect", |
| 222 |
"//mlir:SPIRVSerialization", |
| 223 |
"//third-party/unittest:gmock", |
| 224 |
"//third-party/unittest:gtest_main", |
| 225 |
], |
| 226 |
) |
| 227 |
|
| 228 |
cc_test( |
| 229 |
name = "transform_dialect_tests", |
| 230 |
size = "small", |
| 231 |
srcs = glob([ |
| 232 |
"Dialect/Transform/*.cpp", |
| 233 |
]), |
| 234 |
deps = [ |
| 235 |
"//llvm:Support", |
| 236 |
"//llvm:TestingSupport", |
| 237 |
"//mlir:BytecodeReader", |
| 238 |
"//mlir:FuncDialect", |
| 239 |
"//mlir:IR", |
| 240 |
"//mlir:MlirOptLib", |
| 241 |
"//mlir:Parser", |
| 242 |
"//mlir:Pass", |
| 243 |
"//mlir:Support", |
| 244 |
"//mlir:TransformDebugExtension", |
| 245 |
"//mlir:TransformDialect", |
| 246 |
"//mlir:TransformDialectTransforms", |
| 247 |
"//mlir/test:TestTransformDialect", |
| 248 |
"//third-party/unittest:gtest", |
| 249 |
"//third-party/unittest:gtest_main", |
| 250 |
], |
| 251 |
) |
| 252 |
|
| 253 |
cc_test( |
| 254 |
name = "dialect_utils_tests", |
| 255 |
size = "small", |
| 256 |
srcs = glob([ |
| 257 |
"Dialect/Utils/*.cpp", |
| 258 |
]), |
| 259 |
deps = [ |
| 260 |
"//llvm:Support", |
| 261 |
"//llvm:TestingSupport", |
| 262 |
"//mlir:DialectUtils", |
| 263 |
"//mlir:IR", |
| 264 |
"//third-party/unittest:gmock", |
| 265 |
"//third-party/unittest:gtest", |
| 266 |
"//third-party/unittest:gtest_main", |
| 267 |
], |
| 268 |
) |
| 269 |
|
| 270 |
gentbl_cc_library( |
| 271 |
name = "EnumsIncGen", |
| 272 |
tbl_outs = { |
| 273 |
"TableGen/EnumsGenTest.h.inc": ["-gen-enum-decls"], |
| 274 |
"TableGen/EnumsGenTest.cpp.inc": ["-gen-enum-defs"], |
| 275 |
}, |
| 276 |
tblgen = "//mlir:mlir-tblgen", |
| 277 |
td_file = "TableGen/enums.td", |
| 278 |
deps = [ |
| 279 |
"//mlir:OpBaseTdFiles", |
| 280 |
], |
| 281 |
) |
| 282 |
|
| 283 |
gentbl_cc_library( |
| 284 |
name = "PassIncGen", |
| 285 |
tbl_outs = {"TableGen/PassGenTest.h.inc": ["-gen-pass-decls"]}, |
| 286 |
tblgen = "//mlir:mlir-tblgen", |
| 287 |
td_file = "TableGen/passes.td", |
| 288 |
deps = [ |
| 289 |
"//mlir:PassBaseTdFiles", |
| 290 |
"//mlir:RewritePassBaseTdFiles", |
| 291 |
], |
| 292 |
) |
| 293 |
|
| 294 |
cc_test( |
| 295 |
name = "tablegen_tests", |
| 296 |
size = "small", |
| 297 |
srcs = glob([ |
| 298 |
"TableGen/*.cpp", |
| 299 |
]) + [ |
| 300 |
"TableGen/EnumsGenTest.cpp.inc", |
| 301 |
"TableGen/EnumsGenTest.h.inc", |
| 302 |
], |
| 303 |
includes = ["TableGen/"], |
| 304 |
deps = [ |
| 305 |
":EnumsIncGen", |
| 306 |
":PassIncGen", |
| 307 |
"//llvm:Support", |
| 308 |
"//llvm:TestingSupport", |
| 309 |
"//mlir:IR", |
| 310 |
"//mlir:Pass", |
| 311 |
"//mlir:Support", |
| 312 |
"//mlir:TableGen", |
| 313 |
"//mlir/test:TestDialect", |
| 314 |
"//third-party/unittest:gmock", |
| 315 |
"//third-party/unittest:gtest_main", |
| 316 |
], |
| 317 |
) |
| 318 |
|
| 319 |
cc_test( |
| 320 |
name = "transforms_test", |
| 321 |
size = "small", |
| 322 |
srcs = glob([ |
| 323 |
"Transforms/*.cpp", |
| 324 |
]), |
| 325 |
deps = [ |
| 326 |
"//mlir:AffineAnalysis", |
| 327 |
"//mlir:BytecodeReader", |
| 328 |
"//mlir:IR", |
| 329 |
"//mlir:Parser", |
| 330 |
"//mlir:Pass", |
| 331 |
"//mlir:SideEffectInterfaces", |
| 332 |
"//mlir:TransformUtils", |
| 333 |
"//mlir:Transforms", |
| 334 |
"//third-party/unittest:gtest", |
| 335 |
"//third-party/unittest:gtest_main", |
| 336 |
], |
| 337 |
) |
| 338 |
|
| 339 |
cc_test( |
| 340 |
name = "analysis_tests", |
| 341 |
size = "small", |
| 342 |
srcs = glob([ |
| 343 |
"Analysis/*/*.cpp", |
| 344 |
"Analysis/*/*.h", |
| 345 |
]), |
| 346 |
deps = [ |
| 347 |
"//llvm:TestingSupport", |
| 348 |
"//mlir:AffineAnalysis", |
| 349 |
"//mlir:Analysis", |
| 350 |
"//mlir:AsmParser", |
| 351 |
"//mlir:IR", |
| 352 |
"//mlir:Parser", |
| 353 |
"//mlir:Support", |
| 354 |
"//third-party/unittest:gmock", |
| 355 |
"//third-party/unittest:gtest", |
| 356 |
"//third-party/unittest:gtest_main", |
| 357 |
], |
| 358 |
) |
| 359 |
|
| 360 |
cc_test( |
| 361 |
name = "bytecode_tests", |
| 362 |
size = "small", |
| 363 |
srcs = glob([ |
| 364 |
"Bytecode/*.cpp", |
| 365 |
]), |
| 366 |
deps = [ |
| 367 |
"//llvm:Support", |
| 368 |
"//mlir:BytecodeReader", |
| 369 |
"//mlir:BytecodeWriter", |
| 370 |
"//mlir:IR", |
| 371 |
"//mlir:Parser", |
| 372 |
"//mlir:SideEffectInterfaces", |
| 373 |
"//third-party/unittest:gmock", |
| 374 |
"//third-party/unittest:gtest", |
| 375 |
"//third-party/unittest:gtest_main", |
| 376 |
], |
| 377 |
) |
| 378 |
|
| 379 |
cc_test( |
| 380 |
name = "conversion_tests", |
| 381 |
size = "small", |
| 382 |
srcs = glob([ |
| 383 |
"Conversion/*/*.cpp", |
| 384 |
]), |
| 385 |
deps = [ |
| 386 |
"//mlir:ArithDialect", |
| 387 |
"//mlir:IR", |
| 388 |
"//mlir:PDLToPDLInterp", |
| 389 |
"//third-party/unittest:gtest", |
| 390 |
"//third-party/unittest:gtest_main", |
| 391 |
], |
| 392 |
) |
| 393 |
|
| 394 |
cc_test( |
| 395 |
name = "execution_engine_tests", |
| 396 |
size = "small", |
| 397 |
srcs = glob([ |
| 398 |
"ExecutionEngine/*.cpp", |
| 399 |
]), |
| 400 |
tags = [ |
| 401 |
# MSAN does not work with JIT. |
| 402 |
"nomsan", |
| 403 |
], |
| 404 |
deps = [ |
| 405 |
"//llvm:Support", |
| 406 |
"//llvm:TestingSupport", |
| 407 |
"//mlir:AllPassesAndDialects", |
| 408 |
"//mlir:Analysis", |
| 409 |
"//mlir:ArithToLLVM", |
| 410 |
"//mlir:BuiltinToLLVMIRTranslation", |
| 411 |
"//mlir:BytecodeReader", |
| 412 |
"//mlir:ExecutionEngine", |
| 413 |
"//mlir:FuncDialect", |
| 414 |
"//mlir:FuncToLLVM", |
| 415 |
"//mlir:IR", |
| 416 |
"//mlir:LLVMToLLVMIRTranslation", |
| 417 |
"//mlir:LinalgTransforms", |
| 418 |
"//mlir:MemRefToLLVM", |
| 419 |
"//mlir:Parser", |
| 420 |
"//mlir:Pass", |
| 421 |
"//mlir:ReconcileUnrealizedCasts", |
| 422 |
"//mlir:ToLLVMIRTranslation", |
| 423 |
"//mlir:VectorToLLVM", |
| 424 |
"//mlir:VectorToSCF", |
| 425 |
"//mlir:mlir_c_runner_utils", |
| 426 |
"//mlir:mlir_runner_utils", |
| 427 |
"//third-party/unittest:gmock", |
| 428 |
"//third-party/unittest:gtest_main", |
| 429 |
], |
| 430 |
) |