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:
parent
2fe311164f
commit
abff245023
tensorflow/compiler/xla
@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user