From e4a6158a07d643a525f5b95d30c854d5a007bf2a Mon Sep 17 00:00:00 2001 From: Tres Popp Date: Fri, 13 Nov 2020 11:58:12 -0800 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@c30ab6c2a307 Updates LLVM usage to match [c30ab6c2a307](https://github.com/llvm/llvm-project/commit/c30ab6c2a307) PiperOrigin-RevId: 342309362 Change-Id: I7e966f259ba3ba79824f9575dab44ee1a8e4968b --- .../mlir-module-serialized-str-attr.mlir | 2 +- .../tests/tf_saved_model/debug_info.py | 4 ++-- tensorflow/compiler/mlir/tfr/ir/tfr_ops.td | 2 +- .../xla/service/cpu/simple_orc_jit.cc | 4 +++- tensorflow/python/compiler/mlir/mlir.py | 2 +- tensorflow/workspace.bzl | 4 ++-- third_party/mlir/BUILD | 19 +++++++++++++++++++ 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/tensorflow/compiler/mlir/tensorflow/tests/compile_mlir_util/mlir-module-serialized-str-attr.mlir b/tensorflow/compiler/mlir/tensorflow/tests/compile_mlir_util/mlir-module-serialized-str-attr.mlir index 85ebbb9cfcd..36c1b5ea51a 100644 --- a/tensorflow/compiler/mlir/tensorflow/tests/compile_mlir_util/mlir-module-serialized-str-attr.mlir +++ b/tensorflow/compiler/mlir/tensorflow/tests/compile_mlir_util/mlir-module-serialized-str-attr.mlir @@ -7,4 +7,4 @@ module attributes {tf.versions = {producer = 888 : i32}} { } loc(unknown) } loc(unknown) -// CHECK: "module attributes {tf.versions = {producer = 888 : i32}} {\0A func @main(%arg0: tensor) -> tensor {\0A %0 = \22tf.Identity\22(%arg0) : (tensor) -> tensor loc(unknown)\0A return %0 : tensor loc(unknown)\0A } loc(unknown)\0A} loc(unknown)" +// CHECK: "module attributes {tf.versions = {producer = 888 : i32}} {\0A func @main(%arg0: tensor) -> tensor {\0A %0 = \22tf.Identity\22(%arg0) : (tensor) -> tensor loc(unknown)\0A return %0 : tensor loc(unknown)\0A } loc(unknown)\0A} loc(unknown)\0A" diff --git a/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py b/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py index 590a294599d..9356163d1bf 100644 --- a/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py +++ b/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/debug_info.py @@ -34,8 +34,8 @@ class TestModule(tf.Module): return x + y # Basic check that the debug info file is being correctly saved and loaded. # - # CHECK: #[[LOC:.*]] = loc({{.*}}callsite("{{[^"]*}}/debug_info.py":{{[0-9]+}}:{{[0-9]+}} - # CHECK: "tf.AddV2"{{.*}}#[[LOC]] + # CHECK: "tf.AddV2"{{.*}}loc(#[[LOC:.*]]) + # CHECK: #[[LOC]] = loc({{.*}}callsite("{{[^"]*}}/debug_info.py":{{[0-9]+}}:{{[0-9]+}} if __name__ == '__main__': diff --git a/tensorflow/compiler/mlir/tfr/ir/tfr_ops.td b/tensorflow/compiler/mlir/tfr/ir/tfr_ops.td index 500b87026ae..4c2ecc0b531 100644 --- a/tensorflow/compiler/mlir/tfr/ir/tfr_ops.td +++ b/tensorflow/compiler/mlir/tfr/ir/tfr_ops.td @@ -366,7 +366,7 @@ def TFR_TFRFuncOp : TFR_Op<"func", [HasParent<"ModuleOp">, Syntax: ``` - op ::= `tfr.func` symbol-ref-id `(` argument-list `)` (`->` + op ::= `tfr.func` visibility? symbol-ref-id `(` argument-list `)` (`->` function-result-list)? function-attributes? region ``` diff --git a/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc b/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc index 41f24af6652..5c63f90133c 100644 --- a/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc +++ b/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc @@ -163,7 +163,9 @@ llvm::Expected> SimpleOrcJIT::Create( LLVMCompiler::ModuleHook pre_optimization_hook, LLVMCompiler::ModuleHook post_optimization_hook, std::function post_codegen_hook) { - auto target_process_control = llvm::orc::SelfTargetProcessControl::Create(); + auto SSP = std::make_shared(); + auto target_process_control = + llvm::orc::SelfTargetProcessControl::Create(std::move(SSP)); if (!target_process_control) { return target_process_control.takeError(); } diff --git a/tensorflow/python/compiler/mlir/mlir.py b/tensorflow/python/compiler/mlir/mlir.py index 3b72abc2850..1fcb1e130ae 100644 --- a/tensorflow/python/compiler/mlir/mlir.py +++ b/tensorflow/python/compiler/mlir/mlir.py @@ -68,7 +68,7 @@ def convert_function(concrete_function, pass_pipeline='tf-standard-pipeline'): ... tf.TensorSpec(None, tf.dtypes.float32), ... tf.TensorSpec(None, tf.dtypes.float32)) >>> tf.mlir.experimental.convert_function(concrete_function) - '...module attributes {...} {...}' + '...module attributes {...} {...}...' Args: concrete_function: An object of type ConcreteFunction. diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index ac92a84e230..8799e7ed5c2 100755 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -686,8 +686,8 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""): ) # Check out LLVM and MLIR from llvm-project. - LLVM_COMMIT = "76b6cb515b2f385f8cdd3c41ecd31c78698f20b2" - LLVM_SHA256 = "711ce462f3c48bbc17395c160790f9221469c90f0b5a8419f5b758221fc5c1ef" + LLVM_COMMIT = "c30ab6c2a307cfdce8323ed94c3d70eb2d26bc14" + LLVM_SHA256 = "5f2ff1217222d74b347f5c9c4e11545c42818b4d1d14282532b7171334eaf190" 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), diff --git a/third_party/mlir/BUILD b/third_party/mlir/BUILD index 2e8beac628e..6afef41118c 100644 --- a/third_party/mlir/BUILD +++ b/third_party/mlir/BUILD @@ -316,6 +316,22 @@ gentbl( ], ) +gentbl( + name = "AsyncPassIncGen", + strip_include_prefix = "include", + tbl_outs = [ + ( + "-gen-pass-decls -name Async", + "include/mlir/Dialect/Async/Passes.h.inc", + ), + ], + tblgen = ":mlir-tblgen", + td_file = "include/mlir/Dialect/Async/Passes.td", + td_srcs = [ + ":PassBaseTdFiles", + ], +) + ##---------------------------------------------------------------------------## # AVX512 dialect. ##---------------------------------------------------------------------------## @@ -613,9 +629,11 @@ cc_library( "lib/Dialect/Async/Transforms/*.cpp", "lib/Dialect/Async/Transforms/*.h", ]), + hdrs = ["include/mlir/Dialect/Async/Passes.h"], includes = ["include"], deps = [ ":Async", + ":AsyncPassIncGen", ":IR", ":Pass", ":SCFDialect", @@ -3246,6 +3264,7 @@ cc_library( ":AffineToStandard", ":AffineTransforms", ":Async", + ":AsyncPassIncGen", ":AsyncToLLVM", ":AsyncTransforms", ":ConversionPasses",