[llvm] Reapply "[ORC] Replace ORC's baked-in dependence ... (#163027)" with … (PR #164340)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 24 15:43:20 PDT 2025


rupprecht wrote:

> Previously, that call to `isComplete()` was only in an assert (`assert(Q->isComplete() && "Q is not complete")`), so I wonder if this is exposing an existing race issue -- we only run these tests in tsan mode w/ assertions disabled.

Nope. Prior to this change, tsan tests pass even with that assert changed to this:
```cc
  for (auto &Q : *CompletedQueries) {
    if (!Q->isComplete())
      dbgs() << "Q is not complete";
    Q->handleComplete(*this);
  }
```
So this seems like a new race somehow.

Anyway, at trunk, this fix seems to make the tsan errors go away, although I have no clue if it's a good change:
```cc
  runSessionLocked([&]() {
    for (auto &UQ : EmitQueries->Updated)
      if (UQ->isComplete())
        UQ->handleComplete(*this);
  });
```
WDYT?

https://github.com/llvm/llvm-project/pull/164340


More information about the llvm-commits mailing list