提交 01b030b7 编写于 作者: M Mehdi Amini 提交者: TensorFlower Gardener

Integrate LLVM at llvm/llvm-project@f164534ca8e0

Updates LLVM usage to match
[f164534ca8e0](https://github.com/llvm/llvm-project/commit/f164534ca8e0)

PiperOrigin-RevId: 328046788
Change-Id: I714164211a50e0d273ec49046c66f7e484989428
上级 2e8dec07
......@@ -741,16 +741,13 @@ cc_library(
],
deps = [
":flatbuffer_translate_lib",
":tensorflow_lite",
"//tensorflow/compiler/mlir/tensorflow",
"//tensorflow/compiler/mlir/tensorflow:mlir_roundtrip_flags",
"@com_google_absl//absl/base",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:MlirTranslateMain",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:Translation",
......
......@@ -17,6 +17,7 @@ limitations under the License.
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
#include "mlir/Dialect/Quant/QuantOps.h" // from @llvm-project
#include "mlir/Dialect/Quant/QuantTypes.h" // from @llvm-project
#include "mlir/Dialect/StandardOps/IR/Ops.h" // from @llvm-project
#include "mlir/IR/Attributes.h" // from @llvm-project
......@@ -33,6 +34,8 @@ limitations under the License.
#include "mlir/Translation.h" // from @llvm-project
#include "tensorflow/compiler/mlir/lite/flatbuffer_export.h"
#include "tensorflow/compiler/mlir/lite/flatbuffer_import.h"
#include "tensorflow/compiler/mlir/lite/ir/tfl_ops.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
#include "tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_flags.h"
using llvm::cl::opt;
......@@ -175,5 +178,11 @@ static TranslateToMLIRRegistration FlatBufferFileToMlirTransReg(
});
static TranslateFromMLIRRegistration MLIRToFlatBufferTranslate(
"mlir-to-tflite-flatbuffer", MlirToFlatBufferFileTranslateFunction);
"mlir-to-tflite-flatbuffer", MlirToFlatBufferFileTranslateFunction,
[](DialectRegistry& registry) {
registry.insert<quant::QuantizationDialect>();
registry.insert<TF::TensorFlowDialect>();
registry.insert<TFL::TensorFlowLiteDialect>();
registry.insert<StandardOpsDialect>();
});
} // namespace mlir
// RUN: not flatbuffer_translate -mlir-to-tflite-flatbuffer %s -o - 2>&1 | FileCheck %s
func @main(tensor<3x2xi32>) -> tensor<3x2xi32> {
^bb0(%arg0: tensor<3x2xi32>):
// CHECK: error: 'unknown_op' op dialect is not registered
%0 = "unknown_op"(%arg0) : (tensor<3x2xi32>) -> tensor<3x2xi32>
return %0 : tensor<3x2xi32>
}
......@@ -711,8 +711,8 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
)
# Check out LLVM and MLIR from llvm-project.
LLVM_COMMIT = "02bf5632a94da6c3570df002804f8d3f79c11bfc"
LLVM_SHA256 = "cd21689a7e3ccdfcb90673a4bfb0db3e1a569d92d8003d11f04069667bedceed"
LLVM_COMMIT = "f164534ca8e042ab7bbc25516f88adf027ebe12d"
LLVM_SHA256 = "12a8b03e33c6ac25a2f4d03d9012d872ff7c0e3793e09a5750e64e8365c3cc89"
LLVM_URLS = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
......
......@@ -1759,6 +1759,7 @@ cc_library(
"lib/CodeGen/*.c",
"lib/CodeGen/*.cpp",
"lib/CodeGen/*.inc",
"lib/CodeGen/LiveDebugValues/*.cpp",
"lib/CodeGen/*.h",
]),
hdrs = glob([
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册