Skip to content

[orc] Avoid pathological propogation order #107488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

benlangmuir
Copy link
Collaborator

In certain pathological object files we were getting extremely slow linking because we were repeatedly propogating dependencies to the same blocks instead of accumulating as many changes as possible. Change the order of iteration so that we go through every node in the worklist before returning to any previous node, reducing the number of expensive dependency iterations.

In practice, this took one case from 60 seconds to 2 seconds. Note: the performance is still non-deterministic, because the block order itself is non-deterministic.

rdar://133734391

In certain pathological object files we were getting extremely slow
linking because we were repeatedly propogating dependencies to the same
blocks instead of accumulating as many changes as possible. Change the
order of iteration so that we go through every node in the worklist
before returning to any previous node, reducing the number of expensive
dependency iterations.

In practice, this took one case from 60 seconds to 2 seconds. Note: the
performance is still non-deterministic, because the block order itself
is non-deterministic.

rdar://133734391
@benlangmuir benlangmuir requested a review from lhames September 5, 2024 23:27
Copy link
Contributor

@lhames lhames left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Ben!

@benlangmuir benlangmuir merged commit 61ba60c into llvm:main Sep 6, 2024
9 checks passed
@benlangmuir benlangmuir deleted the boring-speedup branch September 6, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants