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

[SystemZ] Use LCGR/AGHI for i64 XOR with -1 #74882

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Conversation

JonPsson1
Copy link
Contributor

LCGR/AGHI is a more compact way of implementing a 64-bit NOT.

@JonPsson1 JonPsson1 self-assigned this Dec 8, 2023
@JonPsson1
Copy link
Contributor Author

Without the peephole, it produces instead LGHI/XGR, which uses one more register, although it is a constant load off the CP...

@uweigand
Copy link
Member

If we want to do that, the patch looks good. However, I'm still not 100% sure we do want to do it. The sequence is more compact, but we should also verify it has the same execution speed. (On some CPUs, the XILF and XIHF might be able to execute in parallel as they touch different halves of the GPR. The LCGR / AGHI always must be serialized.) We should check the performance on a small loop on actual machines.

@JonPsson1 JonPsson1 merged commit 07056c2 into llvm:main Dec 11, 2023
4 checks passed
@JonPsson1 JonPsson1 deleted the XORm1 branch December 11, 2023 16:28
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.

None yet

2 participants