Move llvm dependency from xla/util.h to xla/service/gpu/ir_emission_utils.h

PiperOrigin-RevId: 347496931
Change-Id: I90524d9bcab0c7c978c8c98b9312bc7f3a753c20
This commit is contained in:
A. Unique TensorFlower 2020-12-14 16:43:29 -08:00 committed by TensorFlower Gardener
parent 2fe311164f
commit abff245023
4 changed files with 7 additions and 7 deletions
tensorflow/compiler/xla

View File

@ -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",
],
)

View File

@ -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",
],
)

View File

@ -18,6 +18,7 @@ limitations under the License.
#include <utility>
#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<mlir::Value> GetHloOutputs(mlir::Operation* op);
bool WritesMlirBuffer(mlir::Operation* op, mlir::Value operand);
template <typename T>
std::vector<T> ToStdVector(const llvm::SmallVectorImpl<T>& v) {
return std::vector<T>(v.begin(), v.end());
}
} // namespace gpu
} // namespace xla

View File

@ -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<T>* container, const T& value) {
// range that is available in F32s (out of a total of 11 exponent bits in F64s).
std::pair<float, float> SplitF64ToF32(double x);
template <typename T>
std::vector<T> ToStdVector(const llvm::SmallVectorImpl<T>& v) {
return std::vector<T>(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