Bump open source llvm revision to 35cf2f42dda4d708741e06570b2dbe91cec4dc41

PiperOrigin-RevId: 308026811
Change-Id: I25760fe9b2c07b267ef3fd5a61122392cfa8e2f9
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index c810f21..3814e9c 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -666,8 +666,8 @@
     )
 
     # Check out LLVM and MLIR from llvm-project.
-    LLVM_COMMIT = "22219cfc6a2a752c53238df4ceea342672392818"
-    LLVM_SHA256 = "e8d6b4a5d52cb78f8464b716a1c97e0d5bb631cf56012a6a9872c15c720738db"
+    LLVM_COMMIT = "35cf2f42dda4d708741e06570b2dbe91cec4dc41"
+    LLVM_SHA256 = "c522ae8860a3cc5807d195d521cc1fc5ef3d27c4598762ea7e38185cef71fe05"
     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/llvm/llvm.autogenerated.BUILD b/third_party/llvm/llvm.autogenerated.BUILD
index db2038e..d283e68 100644
--- a/third_party/llvm/llvm.autogenerated.BUILD
+++ b/third_party/llvm/llvm.autogenerated.BUILD
@@ -1934,6 +1934,7 @@
     ]),
     copts = llvm_copts,
     deps = [
+        ":binary_format",
         ":config",
         ":debug_info_code_view",
         ":debug_info_msf",
diff --git a/third_party/mlir/BUILD b/third_party/mlir/BUILD
index ffb811f..74dfe01 100644
--- a/third_party/mlir/BUILD
+++ b/third_party/mlir/BUILD
@@ -2692,6 +2692,10 @@
     srcs = glob([
         "tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp",
     ]),
+    linkopts = [
+        "-lm",
+        "-lpthread",
+    ],
     deps = [
         ":IR",
         ":Support",
diff --git a/third_party/mlir/tblgen.bzl b/third_party/mlir/tblgen.bzl
index 623d085..bbe64c1 100644
--- a/third_party/mlir/tblgen.bzl
+++ b/third_party/mlir/tblgen.bzl
@@ -21,7 +21,7 @@
         srcs += [td_file]
 
     td_includes_cmd = ["-I external/llvm-project/mlir/include -I external/org_tensorflow"]
-    td_includes_cmd += ["-I $(GENDIR)/third_party/llvm/llvm-project/mlir/include"]
+    td_includes_cmd += ["-I $(GENDIR)/external/llvm-project/mlir/include"]
     for td_include in td_includes:
         td_includes_cmd += ["-I%s" % td_include]
     local_inc = "-I $$(dirname $(location %s))" % td_file