rust/compiler/rustc_codegen_llvm/src
bors b1b26b834d Auto merge of #145093 - nikic:dead-on-return, r=nnethercote
Set dead_on_return attribute for indirect arguments

Set the dead_on_return attribute (added in LLVM 21) for arguments that are passed indirectly, but not byval.

This indicates that the value of the argument on return does not matter, enabling additional dead store elimination.

From LangRef:

> This attribute indicates that the memory pointed to by the argument is dead upon function return, both upon normal return and if the calls unwinds, meaning that the caller will not depend on its contents. Stores that would be observable either on the return path or on the unwind path may be elided.
>
> Specifically, the behavior is as-if any memory written through the pointer during the execution of the function is overwritten with a poison value upon function return. The caller may access the memory, but any load not preceded by a store will return poison.
>
> This attribute does not imply aliasing properties. For pointer arguments that do not alias other memory locations, noalias attribute may be used in conjunction. Conversely, this attribute always implies dead_on_unwind.
>
> This attribute cannot be applied to return values.

This fixes parts of https://github.com/rust-lang/rust/issues/96497.
2025-08-13 04:18:43 +00:00
..
back Auto merge of #144562 - matthiaskrgr:rollup-mlvn7qo, r=matthiaskrgr 2025-07-28 08:50:59 +00:00
builder gpu host code generation 2025-07-18 16:30:42 -07:00
coverageinfo coverage: Remove all unstable support for MC/DC instrumentation 2025-08-06 22:38:52 +10:00
debuginfo Revert "Preserve the .debug_gdb_scripts section" 2025-08-06 18:01:07 +00:00
llvm Set dead_on_return attribute for indirect arguments 2025-08-11 12:39:23 +02:00
abi.rs Set dead_on_return attribute for indirect arguments 2025-08-11 12:39:23 +02:00
allocator.rs Make __rust_alloc_error_handler_should_panic a function 2025-07-03 10:52:21 -07:00
asm.rs emit .att_syntax when global/naked asm use that option 2025-07-09 01:09:55 +02:00
attributes.rs remove rustc_attr_data_structures 2025-07-31 14:19:27 +02:00
base.rs Revert "Preserve the .debug_gdb_scripts section" 2025-08-06 18:01:07 +00:00
builder.rs Stop using uadd.with.overflow 2025-08-08 21:59:28 -07:00
callee.rs remove rustc_attr_data_structures 2025-07-31 14:19:27 +02:00
common.rs gpu host code generation 2025-07-18 16:30:42 -07:00
consts.rs Prevent name collisions with internal implementation details 2025-08-07 13:41:17 +00:00
context.rs Rollup merge of #142097 - ZuseZ4:offload-host1, r=oli-obk 2025-07-22 00:54:24 +08:00
declare.rs make more builder functions generic 2025-07-18 16:23:54 -07:00
errors.rs Use the object crate rather than LLVM for extracting bitcode sections 2025-07-25 11:21:28 +00:00
intrinsic.rs Unify LLVM ctlz/cttz intrinsic generation 2025-07-25 17:56:10 +02:00
lib.rs Remove support for -Zcombine-cgu 2025-07-26 13:52:24 +00:00
llvm_util.rs Rollup merge of #144987 - tgross35:llvm21-f16-f128, r=nikic 2025-08-08 14:22:47 -05:00
mono_item.rs Rollup merge of #143293 - folkertdev:naked-function-kcfi, r=compiler-errors 2025-07-18 04:27:51 +02:00
type_.rs Eliminate all direct uses of LLVMMDStringInContext2 2025-07-14 08:27:08 +00:00
type_of.rs rename BackendRepr::Vector → SimdVector 2025-02-28 17:17:45 +01:00
va_arg.rs Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee 2025-07-07 17:28:14 +00:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00