Skip to content

[AArch64] Runtime-unroll small multi-exit loops on Apple Silicon. #10114

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 3 commits into from
Feb 27, 2025

Conversation

fhahn
Copy link

@fhahn fhahn commented Feb 25, 2025

Extend unrolling preferences to allow more aggressive unrolling of
search loops with 2 exits, building on the TTI hook added in
ad9da92.

In combination with eac23a5 this enables unrolling loops like
std::find, which can improve performance significantly (+15% end-to-end
on a workload that makes heavy use of std::find). It increase the total
number of unrolled loops by ~2.5% across a very large corpus of
workloads.

(cherry-picked from llvm@46a13a5)

rdar://72436671

…lvm#124462)

Add an extra knob to RuntimeUnrollMultiExit to let backends control
whether to allow multi-exit unrolling on a per-loop basis.

This gives backends more fine-grained control on deciding if multi-exit
unrolling is profitable for a given loop and uarch. Similar to
4226e0a.

PR: llvm#124462
(cherry picked from commit ad9da92)
Extend unrolling preferences to allow more aggressive unrolling of
search loops with 2 exits, building on the TTI hook added in
ad9da92.

In combination with eac23a5 this enables unrolling loops like
std::find, which can improve performance significantly (+15% end-to-end
on a workload that makes heavy use of std::find). It increase the total
number of unrolled loops by ~2.5% across a very large corpus of
workloads.
@fhahn fhahn requested a review from a team as a code owner February 25, 2025 17:17
@fhahn
Copy link
Author

fhahn commented Feb 27, 2025

@swift-ci please test

@fhahn fhahn merged commit bb5f004 into swiftlang:stable/20240723 Feb 27, 2025
3 checks passed
@fhahn fhahn deleted the rt-multi-exit-unroll-stable branch February 28, 2025 10:10
fhahn added a commit that referenced this pull request Mar 2, 2025
[ValueTracking] AllowEphemerals for alignment assumptions.

Follow up to pick change missed in #10114 to be able to analyze more loops with early exits.
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.

1 participant