Tony Kan
97bd985467
fix(abi): Restore noundef on PassMode::Cast args in Rust ABI
...
`adjust_for_rust_abi` was casting small aggregates to an integer register
without propagating `noundef`, causing a performance regression (#123183 )
— LLVM could no longer assume the bits were fully defined.
Add `layout_is_noundef` (conservative) + `fields_are_noundef` helper,
then use `cast_to_with_attrs` to forward `NoUndef` when proven:
Scalar → `!is_uninit_valid()`
ScalarPair → both scalars valid + `s1.size + s2.size == layout.size`
(size equality rejects layouts with inter-scalar padding)
Array → recurse into element; empty arrays unconditionally noundef
Arbitrary → `Variants::Single` required; walk fields in offset order —
any gap, non-noundef field, or trailing pad returns false
Union / Primitive / Simd → false (conservative)
Bless `pass-indirectly-attr.stderr` and `debuginfo-dse.rs` for the new
attribute on Cast args. Add `tests/codegen-llvm/abi-noundef-cast.rs`
covering positive Cast cases (arrays, plain structs, single-variant enum)
and negative Cast cases (MaybeUninit, multi-variant enum, field/pair gap,
trailing padding).
Fixes #123183 .
Co-authored-by: Ralf Jung <post@ralfj.de >
2026-02-27 12:08:59 -08:00
..
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2026-01-13 01:16:58 +00:00
2024-03-11 09:36:35 -07:00
2025-09-20 17:58:32 +02:00
2024-09-13 14:10:56 +03:00
2025-09-20 17:58:32 +02:00
2024-03-11 09:36:35 -07:00
2025-09-20 17:58:32 +02:00
2025-09-20 17:58:32 +02:00
2025-04-06 21:41:47 +02:00
2025-04-06 21:41:47 +02:00
2025-04-06 21:41:47 +02:00
2024-11-26 02:50:48 +08:00
2025-11-02 16:20:06 +01:00
2026-02-06 09:29:24 +09:00
2026-02-06 09:29:24 +09:00
2026-02-06 09:29:24 +09:00
2025-06-24 14:40:11 +02:00
2025-07-03 10:51:06 +03:00
2024-11-26 02:50:48 +08:00
2024-04-15 08:54:11 -04:00
2025-12-18 22:25:34 +01:00
2025-12-18 22:25:34 +01:00
2025-11-02 16:20:06 +01:00
2025-12-18 22:25:34 +01:00
2025-12-18 22:25:34 +01:00
2025-12-18 22:25:34 +01:00
2025-12-18 22:25:34 +01:00
2024-03-11 09:36:35 -07:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-01-01 18:34:24 +01:00
2026-02-12 12:42:39 +01:00
2025-06-12 20:27:10 +02:00
2026-02-05 19:07:50 +00:00
2026-02-05 19:07:50 +00:00
2026-02-05 19:07:50 +00:00
2026-02-05 19:07:50 +00:00
2024-02-16 20:02:50 +00:00
2025-08-04 16:43:53 -04:00
2025-10-13 15:30:26 +02:00
2025-10-21 12:39:49 +11:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-11-02 16:20:06 +01:00
2025-10-13 15:30:26 +02:00
2025-11-02 16:20:06 +01:00
2025-06-24 22:43:00 +00:00
2025-06-24 22:43:00 +00:00
2025-06-24 22:34:30 +00:00
2025-06-24 22:34:30 +00:00
2025-09-12 14:45:12 -04:00
2025-09-12 14:45:12 -04:00
2025-09-20 17:58:32 +02:00
2025-09-20 17:58:32 +02:00
2025-11-05 12:12:10 +01:00
2025-11-05 12:12:10 +01:00
2024-02-16 20:02:50 +00:00
2025-11-04 10:05:02 +01:00
2026-02-27 12:08:59 -08:00
2024-02-16 20:02:50 +00:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-11-02 16:20:06 +01:00
2026-01-24 19:23:17 +02:00
2024-02-16 20:02:50 +00:00
2026-02-09 09:29:16 +01:00
2026-02-09 09:29:16 +01:00
2026-02-09 09:29:16 +01:00
2025-10-13 15:20:49 +02:00
2025-10-13 15:30:26 +02:00
2025-05-18 11:12:25 +05:30
2025-05-18 11:12:25 +05:30
2025-11-02 16:20:06 +01:00
2025-10-13 15:30:26 +02:00
2025-11-06 12:49:48 +01:00
2025-11-06 12:49:48 +01:00
2025-11-06 12:49:48 +01:00
2026-02-09 09:29:16 +01:00
2025-11-02 16:20:06 +01:00
2025-10-13 15:30:26 +02:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-11-05 10:48:29 +00:00
2025-09-20 17:58:32 +02:00
2025-09-20 17:58:32 +02:00
2025-11-10 16:38:28 +01:00
2024-12-27 19:58:16 +11:00
2025-12-18 22:25:34 +01:00
2025-02-27 10:26:33 +00:00
2025-06-25 00:54:02 -07:00
2025-06-25 00:54:02 -07:00
2025-06-25 00:54:02 -07:00
2025-06-25 00:54:02 -07:00
2025-09-02 08:48:12 +02:00
2025-09-02 08:48:12 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-11-02 16:20:06 +01:00
2025-10-13 15:30:26 +02:00
2025-10-13 15:30:26 +02:00
2025-12-04 10:51:34 +01:00
2025-11-02 16:20:06 +01:00
2025-10-13 15:30:26 +02:00
2024-02-16 20:02:50 +00:00
2025-09-20 17:58:32 +02:00