rust/compiler/rustc_codegen_cranelift/src
Trevor Gross 6fa6a854cd
Rollup merge of #144192 - RalfJung:atomicrmw-ptr, r=nikic
atomicrmw on pointers: move integer-pointer cast hacks into backend

Conceptually, we want to have atomic operations on pointers of the form `fn atomic_add(ptr: *mut T, offset: usize, ...)`. However, LLVM does not directly support such operations (https://github.com/llvm/llvm-project/issues/120837), so we have to cast the `offset` to a pointer somewhere.

This PR moves that hack into the LLVM backend, so that the standard library, intrinsic, and Miri all work with the conceptual operation we actually want. Hopefully, one day LLVM will gain a way to represent these operations without integer-pointer casts, and then the hack will disappear entirely.

Cc ```@nikic``` -- this is the best we can do right now, right?
Fixes https://github.com/rust-lang/rust/issues/134617
2025-08-08 14:22:44 -05:00
..
abi compiler: Parse p- specs in datalayout string, allow definition of custom default data address space 2025-07-07 09:04:53 +02:00
debuginfo Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
driver use codegen_instance_attrs where an instance is (easily) available 2025-07-16 23:24:32 +02:00
intrinsics atomicrmw on pointers: move integer-pointer cast hacks into backend 2025-07-23 08:32:55 +02:00
optimize Reformat use declarations. 2024-07-29 08:26:52 +10:00
allocator.rs Make __rust_alloc_error_handler_should_panic a function 2025-07-03 10:52:21 -07:00
analyze.rs rename AddressOf -> RawBorrow inside the compiler 2024-08-18 19:46:53 +02:00
base.rs Remove support for dyn* 2025-07-01 19:00:21 +00:00
cast.rs Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
codegen_f16_f128.rs Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
codegen_i128.rs Windows x86: Change i128 to return via the vector ABI 2025-01-27 12:12:59 +00:00
common.rs compiler: Parse p- specs in datalayout string, allow definition of custom default data address space 2025-07-07 09:04:53 +02:00
compiler_builtins.rs Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
concurrency_limiter.rs Remove jobserver from Session 2024-12-13 10:21:22 +00:00
config.rs Merge commit 'ba315abda7' into sync_cg_clif-2025-03-30 2025-03-30 15:43:48 +00:00
constant.rs Prevent name collisions with internal implementation details 2025-08-07 13:41:17 +00:00
discriminant.rs Change tag_field to FieldIdx in Variants::Multiple 2025-06-03 23:42:21 -07:00
global_asm.rs Fix naked asm symbol name for cg_clif on macOS 2025-04-30 12:59:50 +00:00
inline_asm.rs Update InterpCx::project_field to take FieldIdx 2025-06-05 19:15:56 -07:00
lib.rs cranelift: fix target feature name type: "fxsr" 2025-06-22 16:32:54 +02:00
linkage.rs Sync rustc_codegen_cranelift 'ddd4ce2553' 2021-04-30 14:49:58 +02:00
main_shim.rs Replace some Option<Span> with Span and use DUMMY_SP instead of None 2025-06-05 14:14:59 +00:00
num.rs Replace some Option<Span> with Span and use DUMMY_SP instead of None 2025-06-05 14:14:59 +00:00
pointer.rs Merge commit '1fa693ca44' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
pretty_clif.rs Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
toolchain.rs Merge commit 'e9d1a0a7b0' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
unsize.rs Remove support for dyn* 2025-07-01 19:00:21 +00:00
unwind_module.rs Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00
value_and_place.rs Remove support for dyn* 2025-07-01 19:00:21 +00:00
vtable.rs Remove support for dyn* 2025-07-01 19:00:21 +00:00