Does LLVM's quirk of counting in bits matter to us?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Location
In a lot of different places we document an isize::MAX limit on object sizes, for example, see this: https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html
Summary
So, hypothetically, we "only" can have an object countable by LLVM within 64 bits:
https://github.com/rust-lang/rust/blob/55043f067dcf7067e7c6ebccf3639af94ff57bda/compiler/rustc_abi/src/lib.rs#L340-L350
However, hypothetically, we "should" be able to use an object that is isize::MAX bytes. These two facts contradict each other, since that suggests we should be able to have an object that is greater than 2^61 bytes. It is hard to validate whether or not LLVM miscompiles this, though, as most computers do not deal in greater than around 56 bits of address space.
Anyone working in HPC is encouraged to let us know?
Honestly, it's not even clear what we mean by "object" here. Allocation, probably?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the object-size limit documented for std::slice::from_raw_parts and the LLVM-related code in compiler/rustc_abi/src/lib.rs around lines 340-350. Clarify whether the relevant object is an allocation, how LLVM's bit-counting limit applies, and whether the documented isize::MAX limit is affected; done means a supported conclusion and any required documentation change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, documentation
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100