Latest Results
Collapse redundant Optional wrapping around storage vector access (#29360)
* Avoid receiver duplication in option_lowering unwrap lowerings
`OptionalUnwrap` and `OptionalUnwrapOr` synthesize two member accesses
(`.is_some` and `.val`) on the reconstructed receiver. Previously the
receiver expression was cloned for each access, so a receiver like
`vec.get(idx)` — which lowers to a ternary containing a mapping read —
was emitted twice per unwrap site.
Bind the reconstructed receiver to a fresh `$opt$N` temporary before
building the two member accesses, so the subtree is only emitted once
and downstream passes duplicate just a `Path`.
Includes pass-level tests covering function-call, ternary, nested
unwrap_or, mixed unwrap/unwrap_or, and library / submodule receivers.
Addresses part of #29343.
* Add composite forwarding and boolean ternary folding to ssa_const_propagation
Three orthogonal extensions to the existing fixpoint pass, sharing one
visitor state:
1. Track composite literal bindings whose fields are all atoms (paths or
literals). `let s = S { a: x, b: y }` records `s → {a: x, b: y}` in
an `atom_fielded_composites` map.
2. In `reconstruct_member_access`, forward `x.field` to the stored atom
when `x` is tracked. This is scalar replacement of aggregates for
short-lived structs; the struct binding itself is left for DCE once
every field access is forwarded.
3. In `reconstruct_ternary`, fold all four bool-literal branch
combinations — (true,false) → cond, (false,true) → !cond, and
both-branches-equal → that literal. These commonly arise after the
above composite forwarding erases a boolean flag that was selected
across a ternary.
On its own the composite-forwarding change is a general-purpose SRA that
helps any short-lived aggregate; in combination with #29353's receiver
binding it collapses the option ceremony that storage-vector accesses
generate.
Includes pass-level tests covering literal and path fields, all four
bool-ternary combinations, the non-fold variable-branch case, combined
forwarding-then-folding, the single-hop limitation on nested composites,
and library / submodule struct types used as composite literals.
Addresses part of #29343.
* Update dynamic_storage_interface expectation after Optional wrapping collapse
---------
Co-authored-by: Mohammad Fawaz <mohammadfawaz@gmail.com> Latest Branches
0%
feat/devnode-persistent-storage 0%
josh/wasm-friendly-frontend-abi-path 0%
josh/semantic_hightlighting © 2026 CodSpeed Technology