Skip to content

Arm64 Optimization: (x & m) & n may be better optimized with m and n constants that can be embedded in and instructions #155674

@mcfi

Description

@mcfi

Please see https://godbolt.org/z/KExP3cj8h for an example. If m and n are both constants that can be embedded in Arm64 and instructions, it might be better to emit two and instructions instead of combining the two constants. In practice, there might be complications. For example, if the constant combination can be hoisted outside of a loop and there's no register pressure, then it could be better to do combine the constants outside of the loop and do only one and inside the loop. However, in other cases, having two and instructions is better having three.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions