Skip to content

Replace two reduces with explicit loops in SIMD implementations. #72423

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 2 commits into from
Mar 20, 2024

Conversation

stephentyrone
Copy link
Contributor

reduce has enough machinery that it pushes us over some inlining thresholds before optimizations happen, resulting in much worse codegen for String breadcrumbs. So a nice pickup there, but also generally applicable to other code as well.

split out from #72205

`reduce` has enough machinery that it pushes us over some inlining thresholds before optimizations happen, resulting in much worse codegen for String breadcrumbs. So a nice pickup there, but also generally applicable to other code as well.
@stephentyrone stephentyrone requested a review from a team as a code owner March 19, 2024 16:05
@stephentyrone
Copy link
Contributor Author

@swift-ci smoke test

@stephentyrone
Copy link
Contributor Author

@swift-ci smoke-test

@@ -927,7 +931,13 @@ extension SIMD where Scalar: FloatingPoint {
// llvm.experimental.vector.reduce.fadd or an explicit tree-sum. Open-
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit to past-you: The first line of the implementation note has an elided word, "this eventually" probably needs a "will" or "should" somewhere in there.

@stephentyrone
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@Catfish-Man Catfish-Man left a comment

Choose a reason for hiding this comment

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

As mentioned in the other PR, curious if this should be always-inline, but this is fine regardless

@stephentyrone
Copy link
Contributor Author

We don't want this to be always inline, because it blows out code size if inlined into contexts where it can't be specialized. We really want some sort of "inline if-and-only-if specialized" annotation for these, but I also don't want to further complicate the inlining story...

@stephentyrone stephentyrone merged commit d24843e into swiftlang:main Mar 20, 2024
@stephentyrone stephentyrone deleted the reduce-reduces branch March 20, 2024 14:05
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.

3 participants