rust/tests
bors 733b47ea4b Auto merge of #138759 - scottmcm:operand-builder, r=saethlin
Allow `enum` and `union` literals to also create SSA values

Today, `Some(x)` always goes through an `alloca`, even in trivial cases where the niching means the constructor doesn't even change the value.

For example, <https://rust.godbolt.org/z/6KG6PqoYz>
```rust
pub fn demo(r: &i32) -> Option<&i32> {
    Some(r)
}
```
currently emits the IR
```llvm
define align 4 ptr `@demo(ptr` align 4 %r) unnamed_addr {
start:
  %_0 = alloca [8 x i8], align 8
  store ptr %r, ptr %_0, align 8
  %0 = load ptr, ptr %_0, align 8
  ret ptr %0
}
```
but with this PR it becomes just
```llvm
define align 4 ptr `@demo(ptr` align 4 %r) unnamed_addr {
start:
  ret ptr %r
}
```
(Of course the optimizer can clean that up, but it'd be nice if it didn't have to -- especially in debug where it doesn't run.  This is like rust-lang/rust#123886, but that only handled non-simd `struct`s -- this PR generalizes it to all non-simd ADTs.)

Doing this means handing variants other than `FIRST_VARIANT`, handling the active field for unions, refactoring the discriminant code so the Place and Operand parts can share the calculation, etc.

Other PRs that led up to this one:
- https://github.com/rust-lang/rust/pull/142005
- https://github.com/rust-lang/rust/pull/142103
- https://github.com/rust-lang/rust/pull/142324
- https://github.com/rust-lang/rust/pull/142383

---

try-job: aarch64-gnu
2025-07-05 01:37:08 +00:00
..
assembly tests: s/C-cmse/cmse/ 2025-06-25 00:52:10 -07:00
auxiliary minicore: use core's diagnostic::on_unimplemented messages 2025-07-03 10:22:40 +02:00
codegen Allow all MIR Aggregates to take the operand path (if layout permits) 2025-07-03 22:53:19 -07:00
codegen-units Auto merge of #142893 - Mark-Simulacrum:no-const-collect, r=oli-obk 2025-06-27 12:57:05 +00:00
coverage Remove let_chains feature 2025-06-30 07:49:20 -05:00
coverage-run-rustdoc Update coverage-run-rustdoc output 2025-03-28 10:35:53 +01:00
crashes Remove support for dyn* 2025-07-01 19:00:21 +00:00
debuginfo tests: {Meta,Pointee}Sized in non-minicore tests 2025-06-16 23:04:33 +00:00
incremental Stop requiring HIR for trait item wf checks 2025-06-30 08:45:43 +00:00
mir-opt clean up GVN TypeId test 2025-07-04 19:14:26 +02:00
pretty Move the place in &pin mut $place when !Unpin to ensure soundness 2025-06-15 10:31:11 +08:00
run-make Rollup merge of #143199 - jieyouxu:short-ice, r=RalfJung 2025-06-30 19:23:22 +08:00
rustdoc Rollup merge of #143381 - fee1-dead-contrib:push-pzxuvlnymxpu, r=GuillaumeGomez 2025-07-04 05:47:28 +02:00
rustdoc-gui Update rustdoc GUI tests 2025-07-01 15:49:45 +02:00
rustdoc-js Migrate some tests away from concat-idents 2025-06-24 10:54:54 +00:00
rustdoc-js-std add doc(alias("AsciiChar")) to core::ascii::Char 2025-06-20 11:11:51 -05:00
rustdoc-json Port #[target_feature] to the new attribute parsing infrastructure 2025-07-03 07:54:19 +02:00
rustdoc-ui refactor: Make -Ztrack-diagnostics emit like a note 2025-07-03 07:19:25 -06:00
ui Auto merge of #138759 - scottmcm:operand-builder, r=saethlin 2025-07-05 01:37:08 +00:00
ui-fulldeps Stop backends from needing to support nullary intrinsics 2025-06-30 08:04:19 +00:00
COMPILER_TESTS.md