diff --git a/tensorflow/compiler/xla/BUILD b/tensorflow/compiler/xla/BUILD index 6de4ae517f3..6e996186c28 100644 --- a/tensorflow/compiler/xla/BUILD +++ b/tensorflow/compiler/xla/BUILD @@ -248,7 +248,6 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", - "@llvm-project//llvm:Support", ], ) diff --git a/tensorflow/compiler/xla/service/gpu/BUILD b/tensorflow/compiler/xla/service/gpu/BUILD index 0e8b0d3d228..83d4247f57c 100644 --- a/tensorflow/compiler/xla/service/gpu/BUILD +++ b/tensorflow/compiler/xla/service/gpu/BUILD @@ -841,6 +841,7 @@ cc_library( "//tensorflow/core/platform:stream_executor_no_cuda", "//tensorflow/stream_executor:device_description", "@llvm-project//llvm:Core", + "@llvm-project//llvm:Support", "@llvm-project//mlir:IR", ], ) diff --git a/tensorflow/compiler/xla/service/gpu/ir_emission_utils.h b/tensorflow/compiler/xla/service/gpu/ir_emission_utils.h index 66dab791fc9..bc1d11d699b 100644 --- a/tensorflow/compiler/xla/service/gpu/ir_emission_utils.h +++ b/tensorflow/compiler/xla/service/gpu/ir_emission_utils.h @@ -18,6 +18,7 @@ limitations under the License. #include +#include "llvm/ADT/SmallVector.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Value.h" #include "mlir/IR/Operation.h" // from @llvm-project @@ -252,6 +253,11 @@ std::vector GetHloOutputs(mlir::Operation* op); bool WritesMlirBuffer(mlir::Operation* op, mlir::Value operand); +template +std::vector ToStdVector(const llvm::SmallVectorImpl& v) { + return std::vector(v.begin(), v.end()); +} + } // namespace gpu } // namespace xla diff --git a/tensorflow/compiler/xla/util.h b/tensorflow/compiler/xla/util.h index 13897c417d9..44a5bf4ea33 100644 --- a/tensorflow/compiler/xla/util.h +++ b/tensorflow/compiler/xla/util.h @@ -32,7 +32,6 @@ limitations under the License. #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" #include "absl/types/span.h" -#include "llvm/ADT/SmallVector.h" #include "tensorflow/compiler/xla/status.h" #include "tensorflow/compiler/xla/status_macros.h" #include "tensorflow/compiler/xla/types.h" @@ -579,11 +578,6 @@ Status EraseElementFromVector(std::vector* container, const T& value) { // range that is available in F32s (out of a total of 11 exponent bits in F64s). std::pair SplitF64ToF32(double x); -template -std::vector ToStdVector(const llvm::SmallVectorImpl& v) { - return std::vector(v.begin(), v.end()); -} - // MakeCleanup(f) returns an RAII cleanup object that calls 'f' in its // destructor. The easiest way to use MakeCleanup is with a lambda argument, // capturing the return value in an 'auto' local variable. Most users will not