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

Add peephole optimization to replace x86 SIMD instructions with smaller equivalents #112880

Open
saucecontrol opened this issue Feb 24, 2025 · 1 comment
Labels
area-Meta tenet-performance Performance related issue untriaged New issue has not been triaged by the area owner

Comments

@saucecontrol
Copy link
Member

As pointed out in #112728 (comment), there are some SIMD instructions that have equivalents with smaller encoding.

For example, pupcklpd can be replaced with movlhps, which is 1 byte smaller, under the following conditions:

  1. both operands are from register
  2. both operands are 16-byte
  3. no EVEX options (e.g. embedded masking) are used.

Similarly, vpermilps can be replaced with the smaller vpshufd if mixing float and integer domain instructions is not a concern.

llvm has logic that identifies some of these replacements here

cc @tannergooding

@saucecontrol saucecontrol added the tenet-performance Performance related issue label Feb 24, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 24, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Meta tenet-performance Performance related issue untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant