Skip to content

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

Open
@saucecontrol

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-Metatenet-performancePerformance related issueuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions