Skip to content
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

Specialise for_each_while for multipass + bounded sequences #181

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

tcbrindle
Copy link
Owner

From #173, it seems like the existing formulation of for_each_while() using an is_last() end check appears to get in the way of compiler auto-vectorisation in some circumstances.

For bounded + multipass sequences, we can instead save the end cursor as a local variable and perform an end check against that. This appears to make Clang more eager to vectorise the code in the loop, so let's do it.

From #173,  it seems like the existing formulation of `for_each_while()` using an `is_last()` end check appears to get in the way of compiler auto-vectorisation in some circumstances.

For bounded + multipass sequences, we can instead save the end cursor as a local variable and perform an end check against that. This appears to make Clang more eager to vectorise the code in the loop, so let's do it.
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.07%. Comparing base (bf3540b) to head (6679696).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #181   +/-   ##
=======================================
  Coverage   98.06%   98.07%           
=======================================
  Files          69       69           
  Lines        2433     2440    +7     
=======================================
+ Hits         2386     2393    +7     
  Misses         47       47           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tcbrindle tcbrindle merged commit 67cd4d8 into main Mar 14, 2024
29 checks passed
@tcbrindle tcbrindle deleted the pr/improve_for_each_while branch June 3, 2024 15:56
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