rust/compiler/rustc_codegen_ssa/src/mir
bors 7d7de5bf3c Auto merge of #139088 - spastorino:ergonomic-ref-counting-2, r=nikomatsakis
Ergonomic ref counting: optimize away clones when possible

This PR build on top of https://github.com/rust-lang/rust/pull/134797. It optimizes codegen of ergonomic ref-counting when the type being `use`d is only known to be copy after monomorphization. We avoid codening a clone and generate bitwise copy instead.

RFC: https://github.com/rust-lang/rfcs/pull/3680
Tracking issue: https://github.com/rust-lang/rust/issues/132290
Project goal: https://github.com/rust-lang/rust-project-goals/issues/107

r? `@nikomatsakis`

This PR could better sit on top of https://github.com/rust-lang/rust/pull/131650 but as it did not land yet I've decided to just do minimal changes. It may be the case that doing what I'm doing regress the performance and we may need to go the full route of https://github.com/rust-lang/rust/pull/131650.
cc `@saethlin` in this regard.
2025-04-10 09:08:23 +00:00
..
analyze.rs Don't alloca just to look at a discriminant 2025-03-12 00:56:43 -07:00
block.rs Flatten ifs in rustc_codegen_ssa 2025-03-17 18:56:52 +00:00
constant.rs Stop relying on rustc_type_ir in non-type-system crates 2025-03-15 06:42:48 +00:00
coverageinfo.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
debuginfo.rs When LLVM's location discriminator value limit is exceeded, emit locations with dummy spans instead of dropping them entirely 2025-01-19 07:17:33 -08:00
intrinsic.rs Rollup merge of #138398 - RalfJung:atomic-intrinsics-provenance, r=nnethercote 2025-03-14 01:37:32 -04:00
locals.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
mod.rs Only clone mir body if tcx.features().ergonomic_clones() 2025-04-07 16:53:12 -03:00
naked_asm.rs make -Zwasm-c-abi=legacy suppress the lint 2025-03-25 08:22:35 +01:00
operand.rs Address PR feedback 2025-04-07 18:12:06 -07:00
place.rs Don't alloca just to look at a discriminant 2025-03-12 00:56:43 -07:00
rvalue.rs Auto merge of #138634 - saethlin:repeated-uninit, r=scottmcm,oli-obk 2025-03-25 02:09:15 +00:00
statement.rs reduce false positives of tail-expr-drop-order from consumed values 2024-11-20 20:53:11 +08:00