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

Lower BinOp::Cmp to llvm.{s,u}cmp.* intrinsics #133984

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DaniPopes
Copy link
Contributor

Lowers mir::BinOp::Cmp (three_way_compare intrinsic) to the corresponding LLVM llvm.{s,u}cmp.i8.* intrinsics.

These are the intrinsics mentioned in #118310, which are now available in LLVM 19.

I couldn't find any follow-up PRs/discussions about this, please let me know if I missed something.

r? @scottmcm

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 6, 2024
@nikic
Copy link
Contributor

nikic commented Dec 6, 2024

LLVM 19 doesn't have all the optimization support for these intrinsics yet.

@DaniPopes
Copy link
Contributor Author

Should the check be on LLVM 20?

@rust-log-analyzer

This comment has been minimized.

Lowers `mir::BinOp::Cmp` (`three_way_compare` intrinsic) to the corresponding
LLVM `llvm.{s,u}cmp.i8.*` intrinsics, added in LLVM 19.
@scottmcm
Copy link
Member

scottmcm commented Dec 7, 2024

I'm excited to do this, but if nikic says it's too early, that probably means it shouldn't be on by default yet.

Maybe make this PR adding a -Z flag for it, so people can play with it and test out how close it is?

(Then in the future once it's fully ready we can remove that flag again)

@nikic
Copy link
Contributor

nikic commented Dec 7, 2024

Should the check be on LLVM 20?

Yes, that's fine. You'll have to test locally against LLVM 20 though to make sure codegen tests don't break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants