Geoffrey Martin-Noble | bb37bb8 | 2019-11-06 14:35:36 -0800 | [diff] [blame] | 1 | # Copyright 2019 Google LLC |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 15 | # Misc tools used to optimize, translate, and evaluate IREE. |
Geoffrey Martin-Noble | 48efde6 | 2020-03-23 13:23:44 -0700 | [diff] [blame] | 16 | # Compiler tooling, like the compiler, is not designed to run on device and is tagged as "hostonly". |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 17 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 18 | load( |
| 19 | "//iree:build_defs.oss.bzl", |
| 20 | "IREE_DRIVER_MODULES", |
| 21 | "PLATFORM_VULKAN_DEPS", |
| 22 | iree_cc_binary = "cc_binary", |
| 23 | ) |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 24 | |
| 25 | package( |
| 26 | default_visibility = ["//visibility:public"], |
Geoffrey Martin-Noble | 083ac8e | 2020-07-15 20:10:49 -0700 | [diff] [blame] | 27 | features = ["layering_check"], |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 28 | licenses = ["notice"], # Apache 2.0 |
| 29 | ) |
| 30 | |
| 31 | exports_files([ |
| 32 | "run_lit.sh", |
| 33 | "sanitizer_suppressions.txt", |
| 34 | ]) |
| 35 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 36 | iree_cc_binary( |
Geoffrey Martin-Noble | 3419026 | 2020-02-06 10:43:58 -0800 | [diff] [blame] | 37 | name = "iree-benchmark-module", |
| 38 | testonly = True, |
Geoffrey Martin-Noble | 0a6b9cc | 2020-09-22 20:17:05 -0700 | [diff] [blame^] | 39 | srcs = ["iree-benchmark-module-main.cc"], |
Geoffrey Martin-Noble | 3419026 | 2020-02-06 10:43:58 -0800 | [diff] [blame] | 40 | deps = [ |
| 41 | ":vm_util", |
| 42 | "@com_google_absl//absl/flags:flag", |
| 43 | "@com_google_absl//absl/strings", |
| 44 | "@com_google_benchmark//:benchmark", |
Ahmed S. Taei | f1678df | 2020-08-26 20:38:50 -0700 | [diff] [blame] | 45 | "//iree/base:init", |
Geoffrey Martin-Noble | 3419026 | 2020-02-06 10:43:58 -0800 | [diff] [blame] | 46 | "//iree/base:file_io", |
Geoffrey Martin-Noble | 3419026 | 2020-02-06 10:43:58 -0800 | [diff] [blame] | 47 | "//iree/base:status", |
Ben Vanik | 56d44bf | 2020-05-15 13:20:50 -0700 | [diff] [blame] | 48 | "//iree/base:tracing", |
Geoffrey Martin-Noble | 3419026 | 2020-02-06 10:43:58 -0800 | [diff] [blame] | 49 | "//iree/modules/hal", |
Ben Vanik | e8a9ec4 | 2020-07-16 22:04:57 -0700 | [diff] [blame] | 50 | "//iree/vm", |
Geoffrey Martin-Noble | bbec478 | 2020-03-02 10:50:28 -0800 | [diff] [blame] | 51 | "//iree/vm:bytecode_module", |
Geoffrey Martin-Noble | 3419026 | 2020-02-06 10:43:58 -0800 | [diff] [blame] | 52 | ] + PLATFORM_VULKAN_DEPS + IREE_DRIVER_MODULES, |
| 53 | ) |
| 54 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 55 | iree_cc_binary( |
Ben Vanik | 3555f14 | 2019-12-30 13:44:41 -0800 | [diff] [blame] | 56 | name = "iree-dump-module", |
Geoffrey Martin-Noble | 0a6b9cc | 2020-09-22 20:17:05 -0700 | [diff] [blame^] | 57 | srcs = ["iree-dump-module-main.cc"], |
Ben Vanik | 3555f14 | 2019-12-30 13:44:41 -0800 | [diff] [blame] | 58 | deps = [ |
| 59 | "//iree/base:file_io", # build-cleaner: keep |
| 60 | "//iree/base:flatbuffer_util", |
| 61 | "//iree/base:init", |
Ben Vanik | 3555f14 | 2019-12-30 13:44:41 -0800 | [diff] [blame] | 62 | "//iree/schemas:bytecode_module_def_cc_fbs", |
| 63 | "@com_github_google_flatbuffers//:flatbuffers", |
| 64 | ], |
| 65 | ) |
| 66 | |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 67 | cc_library( |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 68 | name = "init_iree_passes_and_dialects", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 69 | hdrs = [ |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 70 | "init_iree_dialects.h", |
| 71 | "init_iree_passes.h", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 72 | ], |
| 73 | deps = [ |
Marius Brehler | c0cbab6 | 2020-04-16 16:25:21 -0700 | [diff] [blame] | 74 | "//iree/compiler/Dialect/Flow/Analysis", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 75 | "//iree/compiler/Dialect/Flow/IR", |
Marius Brehler | 2dd5738 | 2020-04-14 15:05:12 -0700 | [diff] [blame] | 76 | "//iree/compiler/Dialect/Flow/Transforms", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 77 | "//iree/compiler/Dialect/HAL/IR:HALDialect", |
Marius Brehler | 345a557 | 2020-04-16 12:54:17 -0700 | [diff] [blame] | 78 | "//iree/compiler/Dialect/HAL/Transforms", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 79 | "//iree/compiler/Dialect/IREE/IR", |
Marius Brehler | 2dd5738 | 2020-04-14 15:05:12 -0700 | [diff] [blame] | 80 | "//iree/compiler/Dialect/IREE/Transforms", |
copybara-service[bot] | a744244 | 2020-07-01 13:12:23 -0700 | [diff] [blame] | 81 | "//iree/compiler/Dialect/Sequence/IR", |
Sean Silva | 845dcde | 2020-04-29 17:17:39 -0700 | [diff] [blame] | 82 | "//iree/compiler/Dialect/Shape/Conversion", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 83 | "//iree/compiler/Dialect/Shape/IR", |
Marius Brehler | 2dd5738 | 2020-04-14 15:05:12 -0700 | [diff] [blame] | 84 | "//iree/compiler/Dialect/Shape/Transforms", |
Marius Brehler | 869a574 | 2020-04-16 16:33:14 -0700 | [diff] [blame] | 85 | "//iree/compiler/Dialect/VM/Analysis", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 86 | "//iree/compiler/Dialect/VM/IR", |
Marius Brehler | 2dd5738 | 2020-04-14 15:05:12 -0700 | [diff] [blame] | 87 | "//iree/compiler/Dialect/VM/Transforms", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 88 | "//iree/compiler/Dialect/VMLA/IR:VMLADialect", |
Marius Brehler | 2dd5738 | 2020-04-14 15:05:12 -0700 | [diff] [blame] | 89 | "//iree/compiler/Dialect/VMLA/Transforms", |
Marius Brehler | 23f9a57 | 2020-04-07 14:20:52 -0700 | [diff] [blame] | 90 | "//iree/compiler/Dialect/Vulkan/IR", |
Marius Brehler | 15e5997 | 2020-05-12 16:03:00 -0700 | [diff] [blame] | 91 | "//iree/compiler/Translation:IREEVM", |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 92 | "@llvm-project//mlir:IR", |
| 93 | ], |
| 94 | ) |
| 95 | |
| 96 | cc_library( |
| 97 | name = "init_mlir_passes_and_dialects", |
| 98 | hdrs = [ |
| 99 | "init_mlir_dialects.h", |
| 100 | "init_mlir_passes.h", |
| 101 | ], |
| 102 | deps = [ |
Benjamin Kramer | dbb2337 | 2020-03-23 12:42:40 -0700 | [diff] [blame] | 103 | "@llvm-project//mlir:Affine", |
| 104 | "@llvm-project//mlir:AffineTransforms", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 105 | "@llvm-project//mlir:GPUDialect", |
| 106 | "@llvm-project//mlir:GPUToSPIRVTransforms", |
| 107 | "@llvm-project//mlir:GPUTransforms", |
| 108 | "@llvm-project//mlir:IR", |
| 109 | "@llvm-project//mlir:LLVMDialect", |
| 110 | "@llvm-project//mlir:LinalgOps", |
Mahesh Ravishankar | b78eda5 | 2020-06-12 16:34:30 -0700 | [diff] [blame] | 111 | "@llvm-project//mlir:LinalgPassIncGen", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 112 | "@llvm-project//mlir:LinalgToLLVM", |
| 113 | "@llvm-project//mlir:LinalgToSPIRV", |
| 114 | "@llvm-project//mlir:LinalgTransforms", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 115 | "@llvm-project//mlir:QuantOps", |
iree-copybara-bot | e76bf09 | 2020-05-11 13:01:44 -0700 | [diff] [blame] | 116 | "@llvm-project//mlir:SCFDialect", |
iree-copybara-bot | c5cc101 | 2020-05-15 09:32:35 -0700 | [diff] [blame] | 117 | "@llvm-project//mlir:SCFToGPUPass", |
iree-copybara-bot | e76bf09 | 2020-05-11 13:01:44 -0700 | [diff] [blame] | 118 | "@llvm-project//mlir:SCFTransforms", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 119 | "@llvm-project//mlir:SDBM", |
| 120 | "@llvm-project//mlir:SPIRVDialect", |
| 121 | "@llvm-project//mlir:SPIRVLowering", |
Sean Silva | d3d9037 | 2020-04-27 18:15:48 -0700 | [diff] [blame] | 122 | "@llvm-project//mlir:Shape", |
Marius Brehler | 0c0cd9f | 2020-03-05 15:35:02 -0800 | [diff] [blame] | 123 | "@llvm-project//mlir:StandardOps", |
| 124 | "@llvm-project//mlir:StandardToSPIRVConversions", |
| 125 | "@llvm-project//mlir:Transforms", |
| 126 | "@llvm-project//mlir:VectorOps", |
| 127 | ], |
| 128 | ) |
| 129 | |
| 130 | cc_library( |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 131 | name = "init_compiler_modules", |
| 132 | hdrs = ["init_compiler_modules.h"], |
| 133 | deps = [ |
| 134 | "//iree/compiler/Dialect/Modules/Check/IR:CheckDialect", |
| 135 | "//iree/compiler/Dialect/Modules/Strings/IR:Dialect", |
| 136 | "//iree/compiler/Dialect/Modules/TensorList/IR:TensorListDialect", |
| 137 | ], |
| 138 | ) |
| 139 | |
| 140 | cc_library( |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 141 | name = "init_targets", |
Scott Todd | 6132bb3 | 2020-08-11 12:04:40 -0700 | [diff] [blame] | 142 | srcs = ["init_targets.cc"], |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 143 | hdrs = ["init_targets.h"], |
Scott Todd | 6132bb3 | 2020-08-11 12:04:40 -0700 | [diff] [blame] | 144 | copts = [ |
| 145 | "-DIREE_HAVE_LLVMAOT_TARGET", |
| 146 | "-DIREE_HAVE_LLVMIR_TARGET", |
| 147 | "-DIREE_HAVE_VMLA_TARGET", |
| 148 | "-DIREE_HAVE_VULKANSPIRV_TARGET", |
| 149 | ], |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 150 | deps = [ |
Scott Todd | 8524cb9 | 2020-08-27 11:30:56 -0700 | [diff] [blame] | 151 | "//iree/compiler/Dialect/HAL/Target/LLVM/AOT:LLVMAOT", |
| 152 | "//iree/compiler/Dialect/HAL/Target/LLVM/IR:LLVMIR", |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 153 | "//iree/compiler/Dialect/HAL/Target/VMLA", |
| 154 | "//iree/compiler/Dialect/HAL/Target/VulkanSPIRV", |
| 155 | ], |
| 156 | ) |
| 157 | |
| 158 | cc_library( |
| 159 | name = "init_translations", |
Marius Brehler | ab84e35 | 2020-04-14 15:47:00 -0700 | [diff] [blame] | 160 | hdrs = [ |
| 161 | "init_translations.h", |
| 162 | ], |
| 163 | deps = [ |
Marius Brehler | 0ea7b14 | 2020-05-13 10:20:49 -0700 | [diff] [blame] | 164 | "//iree/compiler/Translation:IREEVM", |
Marius Brehler | ab84e35 | 2020-04-14 15:47:00 -0700 | [diff] [blame] | 165 | "@llvm-project//mlir:SPIRVTranslateRegistration", |
| 166 | ], |
| 167 | ) |
| 168 | |
| 169 | cc_library( |
Marius Brehler | e9a8409 | 2020-05-06 14:20:27 -0700 | [diff] [blame] | 170 | name = "init_xla_dialects", |
| 171 | hdrs = [ |
| 172 | "init_xla_dialects.h", |
| 173 | ], |
| 174 | deps = [ |
| 175 | "@llvm-project//mlir:IR", |
Mehdi Amini | 896de17 | 2020-07-01 12:18:52 -0700 | [diff] [blame] | 176 | "@org_tensorflow//tensorflow/compiler/mlir/hlo", |
| 177 | "@org_tensorflow//tensorflow/compiler/mlir/hlo:lhlo", |
Marius Brehler | e9a8409 | 2020-05-06 14:20:27 -0700 | [diff] [blame] | 178 | ], |
| 179 | ) |
| 180 | |
| 181 | cc_library( |
Marius Brehler | 8ea892d | 2020-03-04 11:02:25 -0800 | [diff] [blame] | 182 | name = "iree_opt_main", |
Geoffrey Martin-Noble | 0a6b9cc | 2020-09-22 20:17:05 -0700 | [diff] [blame^] | 183 | srcs = ["iree-opt-main.cc"], |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 184 | deps = [ |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 185 | ":init_compiler_modules", |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 186 | ":init_iree_passes_and_dialects", |
| 187 | ":init_mlir_passes_and_dialects", |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 188 | ":init_targets", |
Marius Brehler | e9a8409 | 2020-05-06 14:20:27 -0700 | [diff] [blame] | 189 | ":init_xla_dialects", |
Lei Zhang | bb44cf0 | 2020-05-13 11:15:38 -0700 | [diff] [blame] | 190 | "//iree/compiler/Conversion:init_conversions", |
| 191 | "//iree/compiler/Conversion/HLOToLinalg", |
Ben Vanik | 04dec98 | 2019-11-19 14:09:07 -0800 | [diff] [blame] | 192 | "//iree/compiler/Dialect/Flow/Analysis", |
| 193 | "//iree/compiler/Dialect/Flow/IR", |
| 194 | "//iree/compiler/Dialect/Flow/Transforms", |
Marius Brehler | 53f3c8e | 2020-05-12 16:05:11 -0700 | [diff] [blame] | 195 | "//iree/compiler/Dialect/HAL/Conversion:Passes", |
Ben Vanik | f0eea2d | 2019-12-03 18:18:25 -0800 | [diff] [blame] | 196 | "//iree/compiler/Dialect/HAL/Conversion/FlowToHAL", |
Ben Vanik | ab0ece2 | 2019-12-09 17:16:59 -0800 | [diff] [blame] | 197 | "//iree/compiler/Dialect/HAL/Conversion/HALToVM", |
Ben Vanik | 9aa21c2 | 2019-11-25 11:59:04 -0800 | [diff] [blame] | 198 | "//iree/compiler/Dialect/HAL/Transforms", |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 199 | "//iree/compiler/Dialect/IREE/IR", |
| 200 | "//iree/compiler/Dialect/IREE/Transforms", |
copybara-service[bot] | a744244 | 2020-07-01 13:12:23 -0700 | [diff] [blame] | 201 | "//iree/compiler/Dialect/Sequence/IR", |
Sean Silva | d3d9037 | 2020-04-27 18:15:48 -0700 | [diff] [blame] | 202 | "//iree/compiler/Dialect/Shape/Conversion", |
Stella Laurenzo | 9f74554 | 2020-01-23 10:21:19 -0800 | [diff] [blame] | 203 | "//iree/compiler/Dialect/Shape/IR", |
Stella Laurenzo | 3501288 | 2020-01-24 15:09:51 -0800 | [diff] [blame] | 204 | "//iree/compiler/Dialect/Shape/Transforms", |
Ben Vanik | 4becc9e | 2019-11-12 08:25:31 -0800 | [diff] [blame] | 205 | "//iree/compiler/Dialect/VM/Analysis", |
Stella Laurenzo | 15c057f | 2019-11-18 19:20:07 -0800 | [diff] [blame] | 206 | "//iree/compiler/Dialect/VM/Conversion/StandardToVM", |
Ben Vanik | 7a6fa7a | 2019-11-06 14:01:41 -0800 | [diff] [blame] | 207 | "//iree/compiler/Dialect/VM/IR", |
Ben Vanik | 4becc9e | 2019-11-12 08:25:31 -0800 | [diff] [blame] | 208 | "//iree/compiler/Dialect/VM/Transforms", |
Ben Vanik | 6b82073 | 2020-01-29 20:24:24 -0800 | [diff] [blame] | 209 | "//iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA", |
| 210 | "//iree/compiler/Dialect/VMLA/Conversion/VMLAToVM", |
Ben Vanik | 6b82073 | 2020-01-29 20:24:24 -0800 | [diff] [blame] | 211 | "//iree/compiler/Dialect/VMLA/Transforms", |
Lei Zhang | b9e74a9 | 2020-03-02 13:25:25 -0800 | [diff] [blame] | 212 | "//iree/compiler/Dialect/Vulkan/IR", |
Ben Vanik | b2136cb | 2019-12-06 17:11:42 -0800 | [diff] [blame] | 213 | "//iree/compiler/Translation:IREEVM", |
Geoffrey Martin-Noble | 9db8142 | 2020-06-10 18:28:13 -0700 | [diff] [blame] | 214 | "@llvm-project//llvm:Support", |
Lei Zhang | 07c63c2 | 2020-04-14 08:47:27 -0700 | [diff] [blame] | 215 | "@llvm-project//mlir:IR", |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 216 | "@llvm-project//mlir:MlirOptLib", |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 217 | "@llvm-project//mlir:Parser", |
Marius Brehler | 406fead | 2020-03-03 11:05:28 -0800 | [diff] [blame] | 218 | "@llvm-project//mlir:Pass", |
| 219 | "@llvm-project//mlir:Support", |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 220 | "@llvm-project//mlir:TransformUtils", |
Mehdi Amini | 896de17 | 2020-07-01 12:18:52 -0700 | [diff] [blame] | 221 | "@org_tensorflow//tensorflow/compiler/mlir/hlo", |
Mehdi Amini | 552d4e6 | 2020-07-08 20:32:16 -0700 | [diff] [blame] | 222 | "@org_tensorflow//tensorflow/compiler/mlir/hlo:legalize_control_flow", |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 223 | ], |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 224 | ) |
| 225 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 226 | iree_cc_binary( |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 227 | name = "iree-opt", |
Geoffrey Martin-Noble | 48efde6 | 2020-03-23 13:23:44 -0700 | [diff] [blame] | 228 | tags = ["hostonly"], |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 229 | deps = [ |
Marius Brehler | 8ea892d | 2020-03-04 11:02:25 -0800 | [diff] [blame] | 230 | ":iree_opt_main", |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 231 | ], |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 232 | ) |
| 233 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 234 | iree_cc_binary( |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 235 | name = "iree-run-mlir", |
Geoffrey Martin-Noble | 0a6b9cc | 2020-09-22 20:17:05 -0700 | [diff] [blame^] | 236 | srcs = ["iree-run-mlir-main.cc"], |
Geoffrey Martin-Noble | 48efde6 | 2020-03-23 13:23:44 -0700 | [diff] [blame] | 237 | tags = ["hostonly"], |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 238 | deps = [ |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 239 | ":init_compiler_modules", |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 240 | ":init_iree_passes_and_dialects", |
| 241 | ":init_mlir_passes_and_dialects", |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 242 | ":init_targets", |
Geoffrey Martin-Noble | 9228670 | 2020-09-02 11:19:31 -0700 | [diff] [blame] | 243 | ":init_xla_dialects", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 244 | ":vm_util", |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 245 | "@com_google_absl//absl/flags:flag", |
| 246 | "@com_google_absl//absl/strings", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 247 | "@com_google_absl//absl/types:span", |
Ben Vanik | 5f24fb5 | 2019-12-23 15:50:56 -0800 | [diff] [blame] | 248 | "//iree/base:api", |
Ben Vanik | 56d44bf | 2020-05-15 13:20:50 -0700 | [diff] [blame] | 249 | "//iree/base:tracing", |
Ben Vanik | 5f24fb5 | 2019-12-23 15:50:56 -0800 | [diff] [blame] | 250 | "//iree/compiler/Dialect/Flow/Transforms", |
| 251 | "//iree/compiler/Dialect/HAL/Transforms", |
Geoffrey Martin-Noble | 64ec45f | 2020-01-03 17:03:46 -0800 | [diff] [blame] | 252 | "//iree/compiler/Dialect/IREE/Transforms", |
Marius Brehler | 24decf3 | 2020-05-11 12:54:23 -0700 | [diff] [blame] | 253 | "//iree/compiler/Dialect/VM/Target:init_targets", |
Ben Vanik | 5f24fb5 | 2019-12-23 15:50:56 -0800 | [diff] [blame] | 254 | "//iree/compiler/Dialect/VM/Target/Bytecode", |
| 255 | "//iree/compiler/Dialect/VM/Transforms", |
| 256 | "//iree/hal:api", |
| 257 | "//iree/modules/hal", |
Ben Vanik | 97a824f | 2019-12-31 17:42:23 -0800 | [diff] [blame] | 258 | "//iree/vm", |
| 259 | "//iree/vm:bytecode_module", |
Geoffrey Martin-Noble | 9db8142 | 2020-06-10 18:28:13 -0700 | [diff] [blame] | 260 | "@llvm-project//llvm:Support", |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 261 | "@llvm-project//mlir:IR", |
| 262 | "@llvm-project//mlir:Parser", |
| 263 | "@llvm-project//mlir:Pass", |
| 264 | "@llvm-project//mlir:Support", |
Ben Vanik | 5f24fb5 | 2019-12-23 15:50:56 -0800 | [diff] [blame] | 265 | "//iree/base:init", |
| 266 | "//iree/base:status", |
| 267 | "//iree/compiler/Translation:IREEVM", |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 268 | ] + PLATFORM_VULKAN_DEPS + IREE_DRIVER_MODULES, |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 269 | ) |
| 270 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 271 | iree_cc_binary( |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 272 | name = "iree-run-module", |
Geoffrey Martin-Noble | 0a6b9cc | 2020-09-22 20:17:05 -0700 | [diff] [blame^] | 273 | srcs = ["iree-run-module-main.cc"], |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 274 | deps = [ |
| 275 | ":vm_util", |
| 276 | "@com_google_absl//absl/flags:flag", |
| 277 | "@com_google_absl//absl/strings", |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 278 | "//iree/base:file_io", |
| 279 | "//iree/base:init", |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 280 | "//iree/base:status", |
Ben Vanik | 56d44bf | 2020-05-15 13:20:50 -0700 | [diff] [blame] | 281 | "//iree/base:tracing", |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 282 | "//iree/modules/hal", |
Ben Vanik | e8a9ec4 | 2020-07-16 22:04:57 -0700 | [diff] [blame] | 283 | "//iree/vm", |
Geoffrey Martin-Noble | e64004d | 2020-02-03 16:13:46 -0800 | [diff] [blame] | 284 | "//iree/vm:bytecode_module", |
| 285 | ] + PLATFORM_VULKAN_DEPS + IREE_DRIVER_MODULES, |
Ben Vanik | 5f24fb5 | 2019-12-23 15:50:56 -0800 | [diff] [blame] | 286 | ) |
| 287 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 288 | iree_cc_binary( |
Ben Vanik | 7a6fa7a | 2019-11-06 14:01:41 -0800 | [diff] [blame] | 289 | name = "iree-tblgen", |
Geoffrey Martin-Noble | 48efde6 | 2020-03-23 13:23:44 -0700 | [diff] [blame] | 290 | tags = ["hostonly"], |
Ben Vanik | 7a6fa7a | 2019-11-06 14:01:41 -0800 | [diff] [blame] | 291 | deps = [ |
Ben Vanik | 0ef0256 | 2020-03-26 16:02:18 -0700 | [diff] [blame] | 292 | "//iree/compiler/Dialect/IREE/Tools", |
Ben Vanik | 7a6fa7a | 2019-11-06 14:01:41 -0800 | [diff] [blame] | 293 | "//iree/compiler/Dialect/VM/Tools", |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 294 | "@llvm-project//mlir:MlirTableGenMain", |
| 295 | "@llvm-project//mlir:Support", |
| 296 | "@llvm-project//mlir:TableGen", |
Ben Vanik | 7a6fa7a | 2019-11-06 14:01:41 -0800 | [diff] [blame] | 297 | ], |
| 298 | ) |
| 299 | |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 300 | cc_library( |
Marius Brehler | 6d8b59b | 2020-03-05 19:22:35 -0800 | [diff] [blame] | 301 | name = "iree_translate_main", |
Geoffrey Martin-Noble | 0a6b9cc | 2020-09-22 20:17:05 -0700 | [diff] [blame^] | 302 | srcs = ["iree-translate-main.cc"], |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 303 | deps = [ |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 304 | ":init_compiler_modules", |
Marius Brehler | 92f74b2 | 2020-05-28 14:37:49 -0700 | [diff] [blame] | 305 | ":init_iree_passes_and_dialects", |
| 306 | ":init_mlir_passes_and_dialects", |
Ben Vanik | a3e50b5 | 2020-04-15 08:40:53 -0700 | [diff] [blame] | 307 | ":init_targets", |
Scott Todd | 43d00f4 | 2020-04-15 17:09:58 -0700 | [diff] [blame] | 308 | ":init_translations", |
Marius Brehler | e9a8409 | 2020-05-06 14:20:27 -0700 | [diff] [blame] | 309 | ":init_xla_dialects", |
Lei Zhang | bb44cf0 | 2020-05-13 11:15:38 -0700 | [diff] [blame] | 310 | "//iree/compiler/Conversion:init_conversions", |
Marius Brehler | 24decf3 | 2020-05-11 12:54:23 -0700 | [diff] [blame] | 311 | "//iree/compiler/Dialect/VM/Target:init_targets", |
Ben Vanik | 4becc9e | 2019-11-12 08:25:31 -0800 | [diff] [blame] | 312 | "//iree/compiler/Dialect/VM/Target/Bytecode", |
Ben Vanik | dab870d | 2019-11-19 14:23:24 -0800 | [diff] [blame] | 313 | "//iree/compiler/Translation:IREEVM", |
Geoffrey Martin-Noble | 9db8142 | 2020-06-10 18:28:13 -0700 | [diff] [blame] | 314 | "@llvm-project//llvm:Support", |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 315 | "@llvm-project//mlir:IR", |
| 316 | "@llvm-project//mlir:Pass", |
iree-copybara-bot | e76bf09 | 2020-05-11 13:01:44 -0700 | [diff] [blame] | 317 | "@llvm-project//mlir:SCFTransforms", |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 318 | "@llvm-project//mlir:Support", |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 319 | "@llvm-project//mlir:Translation", |
Marius Brehler | 2301fcb | 2020-04-16 14:35:17 -0700 | [diff] [blame] | 320 | ], |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 321 | ) |
| 322 | |
Stella Laurenzo | 23c9b85 | 2020-05-12 17:27:49 -0700 | [diff] [blame] | 323 | iree_cc_binary( |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 324 | name = "iree-translate", |
Geoffrey Martin-Noble | 48efde6 | 2020-03-23 13:23:44 -0700 | [diff] [blame] | 325 | tags = ["hostonly"], |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 326 | deps = [ |
Marius Brehler | 6d8b59b | 2020-03-05 19:22:35 -0800 | [diff] [blame] | 327 | ":iree_translate_main", |
Ben Vanik | 5224504 | 2019-12-13 14:20:00 -0800 | [diff] [blame] | 328 | ], |
Stella Laurenzo | bd659a1 | 2019-10-23 10:17:48 -0700 | [diff] [blame] | 329 | ) |
| 330 | |
Geoffrey Martin-Noble | 74d8218 | 2019-11-29 15:46:22 -0800 | [diff] [blame] | 331 | sh_binary( |
| 332 | name = "IreeFileCheck", |
| 333 | testonly = True, |
| 334 | srcs = ["IreeFileCheck.sh"], |
Jacques Pienaar | 641453c | 2019-12-30 07:56:43 -0800 | [diff] [blame] | 335 | data = ["@llvm-project//llvm:FileCheck"], |
Geoffrey Martin-Noble | 48efde6 | 2020-03-23 13:23:44 -0700 | [diff] [blame] | 336 | tags = ["hostonly"], |
Geoffrey Martin-Noble | 74d8218 | 2019-11-29 15:46:22 -0800 | [diff] [blame] | 337 | ) |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 338 | |
Geoffrey Martin-Noble | 94d7b6e | 2020-02-20 13:43:10 -0800 | [diff] [blame] | 339 | # TODO(b/146898896): Refactor these into more coherent packages. |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 340 | cc_library( |
| 341 | name = "vm_util", |
| 342 | srcs = ["vm_util.cc"], |
| 343 | hdrs = ["vm_util.h"], |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 344 | deps = [ |
Han-Chung Wang | 19316be | 2020-07-17 05:53:02 -0700 | [diff] [blame] | 345 | "//iree/base:file_io", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 346 | "//iree/base:signature_mangle", |
| 347 | "//iree/base:status", |
| 348 | "//iree/hal:api", |
| 349 | "//iree/modules/hal", |
Ben Vanik | e8a9ec4 | 2020-07-16 22:04:57 -0700 | [diff] [blame] | 350 | "//iree/vm", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 351 | "//iree/vm:bytecode_module", |
Ben Vanik | e8a9ec4 | 2020-07-16 22:04:57 -0700 | [diff] [blame] | 352 | "//iree/vm:ref_cc", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 353 | "@com_google_absl//absl/strings", |
| 354 | "@com_google_absl//absl/types:span", |
| 355 | ], |
| 356 | ) |
| 357 | |
| 358 | cc_test( |
| 359 | name = "vm_util_test", |
| 360 | srcs = ["vm_util_test.cc"], |
| 361 | deps = [ |
| 362 | ":vm_util", |
| 363 | "//iree/base:api", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 364 | "//iree/hal:api", |
Ben Vanik | 44860eb | 2020-03-10 12:24:06 -0700 | [diff] [blame] | 365 | "//iree/hal/vmla:vmla_driver_module", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 366 | "//iree/modules/hal", |
Ben Vanik | 371a865 | 2020-08-09 01:36:48 -0700 | [diff] [blame] | 367 | "//iree/testing:gtest", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 368 | "//iree/testing:gtest_main", |
Ben Vanik | e8a9ec4 | 2020-07-16 22:04:57 -0700 | [diff] [blame] | 369 | "//iree/vm", |
Ben Vanik | 35a7a27 | 2020-08-11 14:11:39 -0700 | [diff] [blame] | 370 | "@com_google_absl//absl/strings", |
Geoffrey Martin-Noble | 934f0b8 | 2020-02-03 15:55:11 -0800 | [diff] [blame] | 371 | ], |
| 372 | ) |