Skip to content

Expose llvm.ptrmask intrinsic #63656

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

Closed
nikic opened this issue Aug 17, 2019 · 2 comments
Closed

Expose llvm.ptrmask intrinsic #63656

nikic opened this issue Aug 17, 2019 · 2 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@nikic
Copy link
Contributor

nikic commented Aug 17, 2019

LLVM recently added a ptrmask intrinsic, intended for use with tagged pointers: https://llvm.org/docs/LangRef.html#llvm-ptrmask-intrinsic

It allows masking off bits from a pointer without going through ptrtoint/inttoptr and breaking alias analysis in the process. We might want to expose this somehow...

@nikic nikic added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Aug 17, 2019
@Centril Centril added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 17, 2019
@leonardo-m
Copy link

This could be a quite useful thing for Rust if handled well (at least used by a Cargo crate).

@Mark-Simulacrum
Copy link
Member

This is now exposed on nightly: https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.mask. Since there's already a tracking issue (#98290), closing in favor of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants