-
Couldn't load subscription status.
- Fork 210
Update to nightly-2025-08-11. #291
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
base: main
Are you sure you want to change the base?
Conversation
- `CoverageInfoBuilderMethods::init_coverage` was removed. - The `ret_ptr` argument was added to `BuilderMethods::atomic_rmw`, see rust-lang/rust#144192.
|
This doesn't work because rust-lang/rust#144192 changed the signature of |
| // We can exchange *ptr with val, and then discard the result. | ||
| self.atomic_rmw(AtomicRmwBinOp::AtomicXchg, ptr, val, order); | ||
| // njn: ? | ||
| self.atomic_rmw(AtomicRmwBinOp::AtomicXchg, ptr, val, order, /* ret_ptr */ true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The true here seems incorrect. From my understanding of this, ret_ptr should be set if the exchange is operating on a pointer(since LLVM does not support atomics on pointers, and this needs a cast to usize).
For most of these operations, the type of ‘’ must be an integer type whose bit width is a power of two greater than or equal to eight. For xchg, this may also be a floating point or a pointer type with the same size constraints as integers.
So, this should be something like is_ptr(don't remember the exact LLVM API here).
| dst: &'ll Value, | ||
| src: &'ll Value, | ||
| order: AtomicOrdering, | ||
| _ret_ptr: bool, // njn: what to do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, if ret_ptr is true, we should cast dst to *usize, src to usize, and then cast the return value back to a *T(by checking the original type of src).
| // Since for any A, A | 0 = A, and performing atomics on constant memory is UB in Rust, we can abuse or to perform atomic reads. | ||
| self.atomic_rmw(AtomicRmwBinOp::AtomicOr, ptr, self.const_int(ty, 0), order) | ||
| // njn: ? | ||
| self.atomic_rmw(AtomicRmwBinOp::AtomicOr, ptr, self.const_int(ty, 0), order, /* ret_ptr */ true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same concern here as for load_operand.
CoverageInfoBuilderMethods::init_coveragewas removed.ret_ptrargument was added toBuilderMethods::atomic_rmw, see atomicrmw on pointers: move integer-pointer cast hacks into backend rust-lang/rust#144192.