Per my frequency analysis this pattern occurs ~16k times in Paradise and ~25k times in goon and TG. It is a top-ten offender on all codebases tested.
However, this optimization is heavily kneecapped by #1842 which causes it to only be applied 664 times in Paradise bytecode. Once that issue is fixed this will become much more significant, as a large number of procs will no longer modify their stack when they return.
(PushReferenceValue, Return) -> ReturnReferenceValue
Per my frequency analysis this pattern occurs ~16k times in Paradise and ~25k times in goon and TG. It is a top-ten offender on all codebases tested.
However, this optimization is heavily kneecapped by #1842 which causes it to only be applied 664 times in Paradise bytecode. Once that issue is fixed this will become much more significant, as a large number of procs will no longer modify their stack when they return.