Skip to content

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Oct 9, 2025

Backport 22b79fb

Requested by: @kasuga-fj

The dependency analysis in MachinePipeliner checks dependencies for
every pair of store instructions in the target basic block. This means
the time complexity of the analysis is `O(N^2)`, where `N` is the number
of store instructions. Therefore, compilation time can become
significantly long when there are too many store instructions.

To mitigate it, this patch introduces logic to count the number of store
instructions at the beginning of the pipeliner and bail out if it
exceeds the threshold. The default value if the threshold should be
large enough. Thus, in most practical cases where the pipeliner is
beneficial, this patch should not cause any performance regression.

Related issue: llvm#150262

(cherry picked from commit 22b79fb)
@llvmbot
Copy link
Member Author

llvmbot commented Oct 9, 2025

@aankit-ca What do you think about merging this PR to the release branch?

@github-project-automation github-project-automation bot moved this from Needs Triage to Needs Merge in LLVM Release Status Oct 10, 2025
@c-rhodes
Copy link
Collaborator

generally seems ok, but I noticed there's no tests on the original PR, was this missed or were any added later?

@aankit-ca
Copy link
Contributor

I think we missed the testcase here, @kasuga-fj Can you please add a small testcase on this PR and also on main too?

@kasuga-fj
Copy link
Contributor

Ah, sorry, that is my silly mistake. Thanks for catching it, I'll submit a PR to add a testcase on main, and request backporting after it's merged.

@c-rhodes c-rhodes moved this from Needs Merge to Needs Test Fix in LLVM Release Status Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Test Fix

Development

Successfully merging this pull request may close these issues.

4 participants