1# Description: 2# Libraries for helping construct LLVM IR for XLA backends. 3 4licenses(["notice"]) # Apache 2.0 5 6package(default_visibility = [":friends"]) 7 8package_group( 9 name = "friends", 10 includes = [ 11 "//tensorflow/compiler/xla:friends", 12 ], 13) 14 15# Filegroup used to collect source files for dependency checking. 16filegroup( 17 name = "c_srcs", 18 data = glob([ 19 "**/*.cc", 20 "**/*.h", 21 ]), 22) 23 24cc_library( 25 name = "alias_analysis", 26 srcs = ["alias_analysis.cc"], 27 hdrs = ["alias_analysis.h"], 28 deps = [ 29 ":ir_array", 30 ":llvm_util", 31 "//tensorflow/compiler/xla:types", 32 "//tensorflow/compiler/xla/service:buffer_assignment", 33 "//tensorflow/compiler/xla/service:hlo", 34 "//tensorflow/compiler/xla/service:logical_buffer", 35 "//tensorflow/core:lib", 36 "@llvm//:core", 37 ], 38) 39 40cc_library( 41 name = "llvm_util", 42 srcs = ["llvm_util.cc"], 43 hdrs = ["llvm_util.h"], 44 deps = [ 45 "//tensorflow/compiler/xla:literal_util", 46 "//tensorflow/compiler/xla:shape_util", 47 "//tensorflow/compiler/xla:types", 48 "//tensorflow/compiler/xla:util", 49 "//tensorflow/compiler/xla:xla_data_proto", 50 "//tensorflow/compiler/xla/service:hlo", 51 "//tensorflow/compiler/xla/service:hlo_module_config", 52 "//tensorflow/compiler/xla/service:name_uniquer", 53 "//tensorflow/core:lib", 54 "@llvm//:core", 55 "@llvm//:support", 56 "@llvm//:target", 57 "@llvm//:transform_utils", 58 ], 59) 60 61cc_library( 62 name = "ir_array", 63 srcs = ["ir_array.cc"], 64 hdrs = ["ir_array.h"], 65 deps = [ 66 ":llvm_util", 67 "//tensorflow/compiler/xla:shape_util", 68 "//tensorflow/compiler/xla:statusor", 69 "//tensorflow/compiler/xla:types", 70 "//tensorflow/compiler/xla:util", 71 "//tensorflow/compiler/xla:xla_data_proto", 72 "//tensorflow/core:lib", 73 "@llvm//:core", 74 ], 75) 76 77cc_library( 78 name = "llvm_loop", 79 srcs = ["llvm_loop.cc"], 80 hdrs = ["llvm_loop.h"], 81 deps = [ 82 ":ir_array", 83 ":llvm_util", 84 "//tensorflow/compiler/xla:shape_util", 85 "//tensorflow/compiler/xla:types", 86 "//tensorflow/compiler/xla:xla_data_proto", 87 "//tensorflow/core:lib", 88 "@llvm//:core", 89 ], 90) 91 92cc_library( 93 name = "loop_emitter", 94 srcs = ["loop_emitter.cc"], 95 hdrs = ["loop_emitter.h"], 96 deps = [ 97 ":ir_array", 98 ":llvm_loop", 99 "//tensorflow/compiler/xla:shape_util", 100 "//tensorflow/compiler/xla:status_macros", 101 "//tensorflow/compiler/xla:statusor", 102 "//tensorflow/compiler/xla:types", 103 "//tensorflow/compiler/xla:xla_data_proto", 104 "//tensorflow/core:lib", 105 "@llvm//:core", 106 ], 107) 108 109cc_library( 110 name = "fused_ir_emitter", 111 srcs = ["fused_ir_emitter.cc"], 112 hdrs = ["fused_ir_emitter.h"], 113 deps = [ 114 ":ir_array", 115 ":llvm_util", 116 ":loop_emitter", 117 ":tuple_ops", 118 "//tensorflow/compiler/xla:status_macros", 119 "//tensorflow/compiler/xla:statusor", 120 "//tensorflow/compiler/xla:util", 121 "//tensorflow/compiler/xla:xla_data_proto", 122 "//tensorflow/compiler/xla/service:elemental_ir_emitter", 123 "//tensorflow/compiler/xla/service:hlo", 124 "//tensorflow/core:lib", 125 "@llvm//:core", 126 ], 127) 128 129cc_library( 130 name = "ops", 131 srcs = ["ops.cc"], 132 hdrs = ["ops.h"], 133 deps = [ 134 ":fused_ir_emitter", 135 ":ir_array", 136 ":llvm_util", 137 ":loop_emitter", 138 "//tensorflow/compiler/xla/service:buffer_assignment", 139 "//tensorflow/compiler/xla/service:elemental_ir_emitter", 140 "//tensorflow/compiler/xla/service:hlo", 141 "//tensorflow/compiler/xla/service/gpu:parallel_loop_emitter", 142 "//tensorflow/compiler/xla/service/gpu:partition_assignment", 143 ], 144) 145 146cc_library( 147 name = "tuple_ops", 148 srcs = ["tuple_ops.cc"], 149 hdrs = ["tuple_ops.h"], 150 deps = [ 151 ":ir_array", 152 ":llvm_util", 153 "//tensorflow/compiler/xla:shape_util", 154 "//tensorflow/compiler/xla:types", 155 "//tensorflow/compiler/xla:xla_data_proto", 156 "//tensorflow/core:lib", 157 "@llvm//:core", 158 ], 159) 160 161cc_library( 162 name = "kernel_support_library", 163 srcs = ["kernel_support_library.cc"], 164 hdrs = ["kernel_support_library.h"], 165 deps = [ 166 ":llvm_loop", 167 "//tensorflow/compiler/xla/service/llvm_ir:llvm_util", 168 "//tensorflow/core:lib", 169 "@llvm//:core", 170 ], 171) 172 173# ----------------------------------------------------------------------------- 174 175filegroup( 176 name = "all_files", 177 srcs = glob( 178 ["**/*"], 179 exclude = [ 180 "**/METADATA", 181 "**/OWNERS", 182 ], 183 ), 184 visibility = ["//tensorflow:__subpackages__"], 185) 186