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

Fix performance regression after OPTNONE changes #646

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

sergeyvfx
Copy link
Contributor

The OPTNONE changes in #638 introduced 25% performance regression in Cycles render engine running on Apple Silicon:

https://projects.blender.org/blender/blender/issues/126408

The reason for this is because as per Clang documentation optnone is incompatible with inline, so none of the functions that is marked as optnone is inlined. The biggest bottleneck for Cycles after that change is _mm_mul_ps.

This change makes it so _mm_mul_ps is inlined and is no longer marked as optnone. This solves the immediate performance regression, and the correctness is verified using the sse2neon's test suit on M2 Ultra and M3 Max, with various optimization levels (default, -O2, -O3).

Additionally, adding -Wstrict-aliasing flag does not introduce new warnings.

The OPTNONE changes in DLTcollab#638 introduced 25% performance regression in
Cycles render engine running on Apple Silicon:

  https://projects.blender.org/blender/blender/issues/126408

The reason for this is because as per Clang documentation optnone is
incompatible with inline, so none of the functions that is marked as
optnone is inlined. The biggest bottleneck for Cycles after that
change is _mm_mul_ps.

This change makes it so _mm_mul_ps is inlined and is no longer marked
as optnone. This solves the immediate performance regression, and the
correctness is verified using the sse2neon's test suit on M2 Ultra
and M3 Max, with various optimization levels (default, -O2, -O3).

Additionally, adding -Wstrict-aliasing flag does not introduce new
warnings.
@jserv jserv requested a review from howjmay August 16, 2024 16:16
@jserv jserv merged commit 227cc41 into DLTcollab:master Aug 16, 2024
16 checks passed
@jserv
Copy link
Member

jserv commented Aug 16, 2024

Thank @sergeyvfx for contributing!

hubot pushed a commit to blender/blender that referenced this pull request Aug 16, 2024
The previous update introduced a regression #126408

This update pulls a fix committed to the upstream:
  DLTcollab/sse2neon#646

Pull Request: https://projects.blender.org/blender/blender/pulls/126413
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