From 7b24084778fbb093ffcc7ca3657ed5da529f18c2 Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Fri, 14 Feb 2025 02:18:30 -0800 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@5586541d220e Updates LLVM usage to match [5586541d220e](https://github.com/llvm/llvm-project/commit/5586541d220e) PiperOrigin-RevId: 726837599 --- third_party/llvm/generated.patch | 10 +++ third_party/llvm/workspace.bzl | 4 +- third_party/shardy/temporary.patch | 61 +++++++------------ third_party/shardy/workspace.bzl | 4 +- .../tsl/third_party/llvm/generated.patch | 10 +++ .../tsl/third_party/llvm/workspace.bzl | 4 +- 6 files changed, 47 insertions(+), 46 deletions(-) diff --git a/third_party/llvm/generated.patch b/third_party/llvm/generated.patch index 509398da979e8..bf1f5b42192fc 100644 --- a/third_party/llvm/generated.patch +++ b/third_party/llvm/generated.patch @@ -1 +1,11 @@ Auto generated patch. Do not edit or delete it, even if empty. +diff -ruN --strip-trailing-cr a/clang/test/Analysis/live-stmts.cpp b/clang/test/Analysis/live-stmts.cpp +--- a/clang/test/Analysis/live-stmts.cpp ++++ b/clang/test/Analysis/live-stmts.cpp +@@ -1,3 +1,6 @@ ++// Disabling this flaky test, see https://github.com/llvm/llvm-project/pull/126913#issuecomment-2655850766 ++// UNSUPPORTED: true ++ + // RUN: %clang_analyze_cc1 -w -analyzer-checker=debug.DumpLiveExprs %s 2>&1\ + // RUN: | FileCheck %s + diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl index 1deec6e325447..35fa9d28e2b78 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" - LLVM_COMMIT = "0e779ad4998ef65907502101c5b82ede05ddfa4e" - LLVM_SHA256 = "d5c2560b2d9ce3ced7951113f2b5d1ea428665678f4dcb1fb8780eb1219ca615" + LLVM_COMMIT = "5586541d220ebbe27d8dea039d0165c3b2694b06" + LLVM_SHA256 = "9eeaef49e6a305e5f540f656ef851d80074476180963b5413c38c751f0e1339f" tf_http_archive( name = name, diff --git a/third_party/shardy/temporary.patch b/third_party/shardy/temporary.patch index 844fd12cf2b1c..b39dbe64376a0 100644 --- a/third_party/shardy/temporary.patch +++ b/third_party/shardy/temporary.patch @@ -1,50 +1,31 @@ +diff --git a/third_party/llvm/generated.patch b/third_party/llvm/generated.patch +index 509398d..bf1f5b4 100644 +--- a/third_party/llvm/generated.patch ++++ b/third_party/llvm/generated.patch +@@ -1 +1,11 @@ + Auto generated patch. Do not edit or delete it, even if empty. ++diff -ruN --strip-trailing-cr a/clang/test/Analysis/live-stmts.cpp b/clang/test/Analysis/live-stmts.cpp ++--- a/clang/test/Analysis/live-stmts.cpp +++++ b/clang/test/Analysis/live-stmts.cpp ++@@ -1,3 +1,6 @@ +++// Disabling this flaky test, see https://github.com/llvm/llvm-project/pull/126913#issuecomment-2655850766 +++// UNSUPPORTED: true +++ ++ // RUN: %clang_analyze_cc1 -w -analyzer-checker=debug.DumpLiveExprs %s 2>&1\ ++ // RUN: | FileCheck %s ++ diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl -index a4f1357..1deec6e 100644 +index 1deec6e..35fa9d2 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" -- LLVM_COMMIT = "ab93bd6959d6d2df1b44c1654938452dc30898b0" -- LLVM_SHA256 = "b4a3598e3d76edc37bab6bc6ea798b811aa1115ad31f43c23a14c81a95ad8612" -+ LLVM_COMMIT = "0e779ad4998ef65907502101c5b82ede05ddfa4e" -+ LLVM_SHA256 = "d5c2560b2d9ce3ced7951113f2b5d1ea428665678f4dcb1fb8780eb1219ca615" +- LLVM_COMMIT = "0e779ad4998ef65907502101c5b82ede05ddfa4e" +- LLVM_SHA256 = "d5c2560b2d9ce3ced7951113f2b5d1ea428665678f4dcb1fb8780eb1219ca615" ++ LLVM_COMMIT = "5586541d220ebbe27d8dea039d0165c3b2694b06" ++ LLVM_SHA256 = "9eeaef49e6a305e5f540f656ef851d80074476180963b5413c38c751f0e1339f" tf_http_archive( name = name, -diff --git a/third_party/stablehlo/temporary.patch b/third_party/stablehlo/temporary.patch -index ef63aa3..b001f25 100755 ---- a/third_party/stablehlo/temporary.patch -+++ b/third_party/stablehlo/temporary.patch -@@ -203,6 +203,30 @@ diff --ruN a/stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeTo - - return success(); - } -+diff --ruN a/stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll b/stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll -+--- stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll -++++ stablehlo/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll -+@@ -21,9 +21,8 @@ -+ return RankedTensorType::get(tensorType.getShape(), rewriter.getI1Type()); -+ }]; -+ -+-Rewrite changeElementTypeToI8(type: Type) -> Type [{ -+- auto tensorType = llvm::cast(type); -+- return RankedTensorType::get(tensorType.getShape(), rewriter.getI8Type()); -++Rewrite getScalarInt8Tensor() -> Type [{ -++ return RankedTensorType::get({1}, rewriter.getI8Type()); -+ }]; -+ -+ Rewrite zerosLike(op: Op, type: Type) -> Op [{ -+@@ -159,7 +158,7 @@ -+ let root = op(input0 : Value, -+ input1 : Value<_: Tosa_Tensor>); -+ rewrite root with { -+- let typei8 = changeElementTypeToI8(inputType); -++ let typei8 = getScalarInt8Tensor(); -+ let zeros = zerosLike(root, typei8); -+ let mulResult = op(input0, input1, zeros) -> (inputType); -+ replace root with mulResult; - diff --ruN a/stablehlo/stablehlo/dialect/Base.cpp b/stablehlo/stablehlo/dialect/Base.cpp - --- stablehlo/stablehlo/dialect/Base.cpp - +++ stablehlo/stablehlo/dialect/Base.cpp diff --git a/third_party/shardy/workspace.bzl b/third_party/shardy/workspace.bzl index 33b16d5c30842..4e9ecfbd900fc 100644 --- a/third_party/shardy/workspace.bzl +++ b/third_party/shardy/workspace.bzl @@ -3,8 +3,8 @@ load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): - SHARDY_COMMIT = "6734e22c31ad8e59d18a647e86e6e43c40c2356a" - SHARDY_SHA256 = "db169e1ef23e4cd8b6b7c2773f28b13430556e48a15348e177832cca8f59d784" + SHARDY_COMMIT = "021f440d65b5d6cefb1bbd37627acf3983476255" + SHARDY_SHA256 = "d8b224526ad73217fb32631a068c7887139a7538d71f96fd7a728ccccd907cd6" tf_http_archive( name = "shardy", diff --git a/third_party/tsl/third_party/llvm/generated.patch b/third_party/tsl/third_party/llvm/generated.patch index 509398da979e8..bf1f5b42192fc 100644 --- a/third_party/tsl/third_party/llvm/generated.patch +++ b/third_party/tsl/third_party/llvm/generated.patch @@ -1 +1,11 @@ Auto generated patch. Do not edit or delete it, even if empty. +diff -ruN --strip-trailing-cr a/clang/test/Analysis/live-stmts.cpp b/clang/test/Analysis/live-stmts.cpp +--- a/clang/test/Analysis/live-stmts.cpp ++++ b/clang/test/Analysis/live-stmts.cpp +@@ -1,3 +1,6 @@ ++// Disabling this flaky test, see https://github.com/llvm/llvm-project/pull/126913#issuecomment-2655850766 ++// UNSUPPORTED: true ++ + // RUN: %clang_analyze_cc1 -w -analyzer-checker=debug.DumpLiveExprs %s 2>&1\ + // RUN: | FileCheck %s + diff --git a/third_party/tsl/third_party/llvm/workspace.bzl b/third_party/tsl/third_party/llvm/workspace.bzl index 1deec6e325447..35fa9d28e2b78 100644 --- a/third_party/tsl/third_party/llvm/workspace.bzl +++ b/third_party/tsl/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" - LLVM_COMMIT = "0e779ad4998ef65907502101c5b82ede05ddfa4e" - LLVM_SHA256 = "d5c2560b2d9ce3ced7951113f2b5d1ea428665678f4dcb1fb8780eb1219ca615" + LLVM_COMMIT = "5586541d220ebbe27d8dea039d0165c3b2694b06" + LLVM_SHA256 = "9eeaef49e6a305e5f540f656ef851d80074476180963b5413c38c751f0e1339f" tf_http_archive( name = name,