Debian Codegraph @

llvm-project/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel

raw
1 # Description:
2 # MLIR Tutorial
3
4 load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
5
6 licenses(["notice"])
7
8 package(default_visibility = ["//visibility:public"])
9
10 td_library(
11 name = "ToyOpsTdFiles",
12 srcs = [
13 "include/toy/Ops.td",
14 "include/toy/ShapeInferenceInterface.td",
15 ],
16 includes = ["include"],
17 deps = [
18 "//mlir:CallInterfacesTdFiles",
19 "//mlir:CastInterfacesTdFiles",
20 "//mlir:FunctionInterfacesTdFiles",
21 "//mlir:OpBaseTdFiles",
22 "//mlir:SideEffectInterfacesTdFiles",
23 ],
24 )
25
26 gentbl_cc_library(
27 name = "ToyInterfacesIncGen",
28 tbl_outs = [
29 (
30 ["-gen-op-interface-decls"],
31 "include/toy/ShapeInferenceOpInterfaces.h.inc",
32 ),
33 (
34 ["-gen-op-interface-defs"],
35 "include/toy/ShapeInferenceOpInterfaces.cpp.inc",
36 ),
37 ],
38 tblgen = "//mlir:mlir-tblgen",
39 td_file = "include/toy/ShapeInferenceInterface.td",
40 deps = [":ToyOpsTdFiles"],
41 )
42
43 gentbl_cc_library(
44 name = "ToyOpsIncGen",
45 tbl_outs = [
46 (
47 ["-gen-op-decls"],
48 "include/toy/Ops.h.inc",
49 ),
50 (
51 ["-gen-op-defs"],
52 "include/toy/Ops.cpp.inc",
53 ),
54 (
55 ["-gen-dialect-decls"],
56 "include/toy/Dialect.h.inc",
57 ),
58 (
59 ["-gen-dialect-defs"],
60 "include/toy/Dialect.cpp.inc",
61 ),
62 ],
63 tblgen = "//mlir:mlir-tblgen",
64 td_file = "include/toy/Ops.td",
65 deps = [":ToyOpsTdFiles"],
66 )
67
68 gentbl_cc_library(
69 name = "ToyCombineIncGen",
70 strip_include_prefix = "mlir",
71 tbl_outs = [
72 (
73 ["-gen-rewriters"],
74 "mlir/ToyCombine.inc",
75 ),
76 ],
77 tblgen = "//mlir:mlir-tblgen",
78 td_file = "mlir/ToyCombine.td",
79 deps = [":ToyOpsTdFiles"],
80 )
81
82 cc_binary(
83 name = "toyc-ch7",
84 srcs = [
85 "toyc.cpp",
86 "parser/AST.cpp",
87 "mlir/MLIRGen.cpp",
88 "mlir/Dialect.cpp",
89 "mlir/LowerToAffineLoops.cpp",
90 "mlir/LowerToLLVM.cpp",
91 "mlir/ToyCombine.cpp",
92 "mlir/ShapeInferencePass.cpp",
93 ] + glob(["include/toy/*.h"]),
94 includes = ["include/"],
95 deps = [
96 ":ToyCombineIncGen",
97 ":ToyInterfacesIncGen",
98 ":ToyOpsIncGen",
99 "//llvm:Core",
100 "//llvm:Support",
101 "//mlir:AffineDialect",
102 "//mlir:AffineToStandard",
103 "//mlir:AffineTransforms",
104 "//mlir:AllPassesAndDialects",
105 "//mlir:Analysis",
106 "//mlir:ArithDialect",
107 "//mlir:ArithToLLVM",
108 "//mlir:CastOpInterfaces",
109 "//mlir:ControlFlowToLLVM",
110 "//mlir:ExecutionEngine",
111 "//mlir:ExecutionEngineUtils",
112 "//mlir:FuncDialect",
113 "//mlir:FuncToLLVM",
114 "//mlir:IR",
115 "//mlir:LLVMCommonConversion",
116 "//mlir:LLVMDialect",
117 "//mlir:LLVMToLLVMIRTranslation",
118 "//mlir:MemRefDialect",
119 "//mlir:MemRefToLLVM",
120 "//mlir:Parser",
121 "//mlir:Pass",
122 "//mlir:SCFDialect",
123 "//mlir:SCFToControlFlow",
124 "//mlir:SideEffectInterfaces",
125 "//mlir:Support",
126 "//mlir:ToLLVMIRTranslation",
127 "//mlir:TransformUtils",
128 "//mlir:Transforms",
129 ],
130 )