Skip to content

[llvm] Clean backport of upstream PR183272 - #23284

Merged
dpiparo merged 3 commits into
root-project:masterfrom
hahnjo:backport-llvm-PR183272
Oct 28, 2026
Merged

dpiparo merged 3 commits into
root-project:masterfrom
hahnjo:backport-llvm-PR183272

Conversation

@hahnjo

@hahnjo hahnjo commented Sep 7, 2026

Copy link
Copy Markdown
Member

Backport llvm/llvm-project@55ce4b7 as a dependency of llvm/llvm-project@db5ffb0 (llvm/llvm-project#183272)

(Clean) alternative to #23249

@hahnjo hahnjo self-assigned this Sep 7, 2026
@hahnjo hahnjo added the in:Cling label Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Test Results

    24 files      24 suites   3d 20h 59m 5s ⏱️
 3 901 tests  3 900 ✅ 0 💤 1 ❌
83 525 runs  83 524 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 3b692372.

♻️ This comment has been updated with latest results.

vepadulano added a commit to vepadulano/root that referenced this pull request Sep 11, 2026
The test is disabled as it sporadically fails due to a performance degradation in LLVM22. That could be fixed by backporting patches from LLVM23, e.g. as done by root-project#23284.

The test coverage for the "unorderedMap" test is kept via "unorderedMapTests", a fully-compiled googletest-based rewrite which had already been added to the test suite. The "Names" test is currently not being replaced.
vepadulano added a commit that referenced this pull request Sep 12, 2026
The test is disabled as it sporadically fails due to a performance degradation in LLVM22. That could be fixed by backporting patches from LLVM23, e.g. as done by #23284.

The test coverage for the "unorderedMap" test is kept via "unorderedMapTests", a fully-compiled googletest-based rewrite which had already been added to the test suite. The "Names" test is currently not being replaced.
ferdymercury pushed a commit to ferdymercury/root that referenced this pull request Oct 16, 2026
The test is disabled as it sporadically fails due to a performance degradation in LLVM22. That could be fixed by backporting patches from LLVM23, e.g. as done by root-project#23284.

The test coverage for the "unorderedMap" test is kept via "unorderedMapTests", a fully-compiled googletest-based rewrite which had already been added to the test suite. The "Names" test is currently not being replaced.
@ferdymercury ferdymercury added this to the 6.42.00 milestone Oct 21, 2026
@pcanal pcanal modified the milestones: 6.42.00, 6.42.00-rc1 Oct 27, 2026
@pcanal pcanal closed this Oct 27, 2026
@pcanal pcanal reopened this Oct 27, 2026
@pcanal
pcanal self-requested a review October 27, 2026 18:29

@pcanal pcanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bring WaitingOnGraph.h on part which the tip of LLVM except for NFC refactors after db5ffb04: (#184775, #184955, #185001, #185152, #185242, #185275, #185388, #194297).

@pcanal
pcanal marked this pull request as ready for review October 27, 2026 18:40
@pcanal
pcanal requested a review from vgvassilev as a code owner October 27, 2026 18:40
@hahnjo
hahnjo marked this pull request as draft October 27, 2026 19:12
@pcanal

pcanal commented Oct 27, 2026

Copy link
Copy Markdown
Member

Putting back in draft as it must not be merged as-is/yet as we need an LLVM tag.

This reapplies 85354c6d8bc, which was reverted in d7347c0b81a due to bot
failures.

In this commit further changes are made to address the bot failure, and
general readability.

WaitingOnGraph::Coalescer::remove is renamed WaitingOnGraph::Coalescer::erase,
since its behavior is now similar to common container erase operations.

WaitingOnGraph::Coalescer::clear is provided to enable a fast reset of
Coalescer state.

SuperNodeBuilder::takeSuperNodes is updated to clear the Coalescer state before
returning the SuperNodes, ensuring that future calls to SuperNodeBuilder::add
do not trip the assert that caused the builder failures.

Backport of root-project/llvm-project@55ce4b7
This commit replaces the core dependence propagation algorithm in
WaitingOnGraph to avoid worst-case behavior in the common case where
dependence graphs are sparse. This algorithm showed up as the underlying
cause of the bug in llvm/llvm-project#179611.

For each call to MaterializationResponsibility::notifyEmitted,
WaitingOnGraph would build the transitive closure of all SuperNodes
whose "waiting on" relationships were affected by the newly emitted
symbols, then propagate any remaining unemitted dependencies through
this transitive closure graph. This approach is simple, but pushes the
algorithm towards n^2 complexity even for sparse dependence graphs.

The new propagation algorithm:
1. Inverts the edge direction in the SymbolDependenceMap data structure:
SymbolDepMap[SN] now contains the set of SuperNodes that depend on SN,
rather than the set that SN depends upon.

2. Pushes dependencies through the SymbolDepMap iteratively until it
reaches a fixed point.

This updated algorithm converges much more quickly than the original for
the testcase reported in the issue, and for other cases tested so far.

No testcase yet, as this only affects performance. I've filed a
follow-up issue, llvm/llvm-project#183251, to
track construction of performance testing infrastructure for
WaitingOnGraph.

Should fix llvm/llvm-project#179611

Backport of root-project/llvm-project@db5ffb0
@hahnjo
hahnjo force-pushed the backport-llvm-PR183272 branch from cf31254 to 462d55c Compare October 28, 2026 07:47
@hahnjo
hahnjo marked this pull request as ready for review October 28, 2026 07:54
@hahnjo
hahnjo force-pushed the backport-llvm-PR183272 branch from 462d55c to 3b69237 Compare October 28, 2026 11:56
@hahnjo
hahnjo requested a review from dpiparo October 28, 2026 13:08
@dpiparo
dpiparo merged commit 0d60adb into root-project:master Oct 28, 2026
62 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants