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

PiperOrigin-RevId: 823941203
This commit is contained in:
A. Unique TensorFlower 2025-10-25 11:12:47 -07:00 committed by TensorFlower Gardener
parent 38eb7fdcdc
commit 6bede44c1a
4 changed files with 115 additions and 25 deletions

View File

@ -1 +1,53 @@
Auto generated patch. Do not edit or delete it, even if empty.
diff -ruN --strip-trailing-cr a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -1768,7 +1768,7 @@
// FIXME: We should be able to derive FailedSymsForQuery from each query once
// we fix how the detach operation works.
struct EmitQueries {
- JITDylib::AsynchronousSymbolQuerySet Updated;
+ JITDylib::AsynchronousSymbolQuerySet Completed;
JITDylib::AsynchronousSymbolQuerySet Failed;
DenseMap<AsynchronousSymbolQuery *, std::shared_ptr<SymbolDependenceMap>>
FailedSymsForQuery;
diff -ruN --strip-trailing-cr a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -2901,13 +2901,23 @@
for (auto &SN : ER.Ready)
IL_collectQueries(
- EQ.Updated, SN->defs(),
+ EQ.Completed, SN->defs(),
[](JITDylib::SymbolTableEntry &E) { E.setState(SymbolState::Ready); },
[](AsynchronousSymbolQuery &Q, JITDylib &JD,
NonOwningSymbolStringPtr Name, JITDylib::SymbolTableEntry &E) {
Q.notifySymbolMetRequiredState(SymbolStringPtr(Name), E.getSymbol());
});
+ // std::erase_if is not available in C++17, and llvm::erase_if does not work
+ // here.
+ for (auto it = EQ.Completed.begin(), end = EQ.Completed.end(); it != end;) {
+ if ((*it)->isComplete()) {
+ ++it;
+ } else {
+ it = EQ.Completed.erase(it);
+ }
+ }
+
#ifdef EXPENSIVE_CHECKS
verifySessionState("exiting ExecutionSession::IL_emit");
#endif
@@ -3043,9 +3053,8 @@
}
}
- for (auto &UQ : EmitQueries->Updated)
- if (UQ->isComplete())
- UQ->handleComplete(*this);
+ for (auto &UQ : EmitQueries->Completed)
+ UQ->handleComplete(*this);
// If there are any bad dependencies then return an error.
if (!BadDeps.empty()) {

View File

@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "704240125ddf17b9b4995871af3759c742a202ba"
LLVM_SHA256 = "0354f1e0c3842bb9f36e590e17bbb91018b014bd5c72736dff0b14d1b3f256e8"
LLVM_COMMIT = "621ed04e28787ade92b98e296332ac71d1b81678"
LLVM_SHA256 = "60729061c07f0e834acb1a18607d2552dc08596e651125a7aea9c37a4b390058"
tf_http_archive(
name = name,

View File

@ -1,35 +1,73 @@
diff --git a/third_party/llvm/generated.patch b/third_party/llvm/generated.patch
index f8fc3c3..509398d 100644
index 509398d..6f93f59 100644
--- a/third_party/llvm/generated.patch
+++ b/third_party/llvm/generated.patch
@@ -1,15 +1 @@
@@ -1 +1,53 @@
Auto generated patch. Do not edit or delete it, even if empty.
-diff -ruN --strip-trailing-cr a/mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp b/mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp
---- a/mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp
-+++ b/mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp
-@@ -189,7 +189,9 @@
-
- DominanceInfo dom;
- llvm::sort(chainOfOps, [&](Operation *l, Operation *r) {
-- return dom.dominates(l, r);
-+ if (l == r)
-+ return false;
-+ return dom.properlyDominates(l, r);
- });
-
- rewriter.setInsertionPoint(chainOfOps.front());
+diff -ruN --strip-trailing-cr a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
++++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+@@ -1768,7 +1768,7 @@
+ // FIXME: We should be able to derive FailedSymsForQuery from each query once
+ // we fix how the detach operation works.
+ struct EmitQueries {
+- JITDylib::AsynchronousSymbolQuerySet Updated;
++ JITDylib::AsynchronousSymbolQuerySet Completed;
+ JITDylib::AsynchronousSymbolQuerySet Failed;
+ DenseMap<AsynchronousSymbolQuery *, std::shared_ptr<SymbolDependenceMap>>
+ FailedSymsForQuery;
+diff -ruN --strip-trailing-cr a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
+--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
++++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
+@@ -2901,13 +2901,23 @@
+
+ for (auto &SN : ER.Ready)
+ IL_collectQueries(
+- EQ.Updated, SN->defs(),
++ EQ.Completed, SN->defs(),
+ [](JITDylib::SymbolTableEntry &E) { E.setState(SymbolState::Ready); },
+ [](AsynchronousSymbolQuery &Q, JITDylib &JD,
+ NonOwningSymbolStringPtr Name, JITDylib::SymbolTableEntry &E) {
+ Q.notifySymbolMetRequiredState(SymbolStringPtr(Name), E.getSymbol());
+ });
+
++ // std::erase_if is not available in C++17, and llvm::erase_if does not work
++ // here.
++ for (auto it = EQ.Completed.begin(), end = EQ.Completed.end(); it != end;) {
++ if ((*it)->isComplete()) {
++ ++it;
++ } else {
++ it = EQ.Completed.erase(it);
++ }
++ }
++
+ #ifdef EXPENSIVE_CHECKS
+ verifySessionState("exiting ExecutionSession::IL_emit");
+ #endif
+@@ -3043,9 +3053,8 @@
+ }
+ }
+
+- for (auto &UQ : EmitQueries->Updated)
+- if (UQ->isComplete())
+- UQ->handleComplete(*this);
++ for (auto &UQ : EmitQueries->Completed)
++ UQ->handleComplete(*this);
+
+ // If there are any bad dependencies then return an error.
+ if (!BadDeps.empty()) {
diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl
index 974f27d..98e83ed 100644
index 98e83ed..335486c 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 = "917d1f20aecfdbdc9e5a7a0eaf947ff7be6fbe15"
- LLVM_SHA256 = "8d3d2fe0dfa882a4c4e1c790e2100bc9506b617f50ab30b0c7e303792d9d522f"
+ LLVM_COMMIT = "704240125ddf17b9b4995871af3759c742a202ba"
+ LLVM_SHA256 = "0354f1e0c3842bb9f36e590e17bbb91018b014bd5c72736dff0b14d1b3f256e8"
- LLVM_COMMIT = "704240125ddf17b9b4995871af3759c742a202ba"
- LLVM_SHA256 = "0354f1e0c3842bb9f36e590e17bbb91018b014bd5c72736dff0b14d1b3f256e8"
+ LLVM_COMMIT = "621ed04e28787ade92b98e296332ac71d1b81678"
+ LLVM_SHA256 = "60729061c07f0e834acb1a18607d2552dc08596e651125a7aea9c37a4b390058"
tf_http_archive(
name = name,

View File

@ -3,8 +3,8 @@
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
SHARDY_COMMIT = "5603c190362a7193d374c908b8fcea1f644e1352"
SHARDY_SHA256 = "db8b1313b9732e8db82de4c65db131a2af4916909fb4df69e729e6f44629a7be"
SHARDY_COMMIT = "59b218bcc81a77142ce68f75b7f3dfce7573dd94"
SHARDY_SHA256 = "6e47a724c68dff26b0e7e28b3b191adef1c259ff2eb31ffcda59fd8fbedfc671"
tf_http_archive(
name = "shardy",