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

Arm64: Improve code generation for Vector<T> comparision #31685

Closed
CarolEidt opened this issue Feb 3, 2020 · 8 comments
Closed

Arm64: Improve code generation for Vector<T> comparision #31685

CarolEidt opened this issue Feb 3, 2020 · 8 comments
Assignees
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI JitUntriaged CLR JIT issues needing additional triage optimization tenet-performance Performance related issue
Milestone

Comments

@CarolEidt
Copy link
Contributor

CarolEidt commented Feb 3, 2020

An example from ConsoleMandel:
Source:

while (increment != Vector<int>.Zero);

Generated code:

            dup     v20.4s, wzr
            cmeq    v21.4s, v19.4s, v20.4s
            uminv   v21.16b, v21.16b
            mov     w0, v21.b[0]
            eor     w0, w0, #1
            and     w0, w0, #1

            cbnz    w0, G_M3984_IG05

I believe that umaxv could be used for the != case. Also, if the result of the comparison is used in a branch, we shouldn't have to produce the precise 1 or 0.

category:cq
theme:vector-codegen
skill-level:intermediate
cost:medium

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Feb 3, 2020
@CarolEidt CarolEidt added arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue labels Feb 3, 2020
@BruceForstall BruceForstall added optimization and removed untriaged New issue has not been triaged by the area owner labels Feb 6, 2020
@AndyAyersMS
Copy link
Member

@CarolEidt @kunalspathak is this something we should put into .NET 5?

@tannergooding
Copy link
Member

Some of this may naturally improve with the changes I did for #35421 and the follow up PR I'll be submitting to handle cases like op_Equality and op_Inequality.

@AndyAyersMS
Copy link
Member

Ok, will put in 5.0, we can revisit later if this is optimistic.

@AndyAyersMS AndyAyersMS added this to the 5.0 milestone May 6, 2020
@BruceForstall
Copy link
Member

@tannergooding @CarolEidt Is there any work left here? Should the issue remain in 5.0?

@kunalspathak
Copy link
Member

In one of my previous PRs Tamar pointed out in #37624 (comment) that addp or uminp is cheaper than uminv, so may be that's the minimum we should do. If @tannergooding is busy, I can take some time to do it.

@BruceForstall
Copy link
Member

I'm moving this to Future.

@BruceForstall BruceForstall modified the milestones: 5.0.0, Future Jul 13, 2020
@BruceForstall BruceForstall added the JitUntriaged CLR JIT issues needing additional triage label Oct 28, 2020
@kunalspathak
Copy link
Member

@EgorBo - can you double check if #65632 handles this pattern?

@EgorBo
Copy link
Member

EgorBo commented Feb 24, 2022

Just checked - yes, it does

@EgorBo EgorBo closed this as completed Feb 24, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2022
@JulieLeeMSFT JulieLeeMSFT modified the milestones: Future, 7.0.0 Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI JitUntriaged CLR JIT issues needing additional triage optimization tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

8 participants