You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A read-only analysis over the typed IR classifies each emitted retain by category
(aliasing copy, call argument, spawn argument, borrowed element load, store into
an aggregate) and, for the categories that become a move when the source's last
real use is the retain site, counts how many are movable. A movable retain pairs
with the moved-from variable's drop, so eliding it elides both. Changes no
codegen.
Driven by a --rc-report CLI flag handled at the top like --explain, over the IR
already exposed on the compile result, so no environment reads live in the
library and nothing is threaded into lower_program.
First measurement on the http hello server: call-arg retains dominate (72 of the
97 movable-category retains) and 56 of them are movable, so the calling-convention
retain is the big lever and about 82 percent of movable-category retains are
actually moves.
"rc-elision (static, per function set): alias {}/{} movable, call-arg {}/{} movable, spawn-arg {}/{} movable, indexed-load {} kept, aggregate-store {} kept; movable retains total {} (each pairs with a drop)",
505
+
self.alias_movable,self.alias_total,
506
+
self.call_arg_movable,self.call_arg_total,
507
+
self.spawn_arg_movable,self.spawn_arg_total,
508
+
self.indexed_load_kept,self.aggregate_store_kept,
509
+
self.movable(),
510
+
)
511
+
}
512
+
}
513
+
514
+
/// Last index at which each variable is read for a real use (excluding its `Drop`, which is a release
515
+
/// rather than a keeping use). The move signal: when a reference's last real use is a retain site, the
516
+
/// retain transfers the only live reference and can become a move.
0 commit comments