Description
This is follow on from #2290. To fully support early returns from dynamic contexts, we need partial evaluation to do additional book keeping on each callable invocation (including the entry point). Specifically, when an explicit return is hit, a store into a special return variable should be inserted into the RIR. Then if there is an implicit return from the callable when any such early return was previously triggered the implicit return should be treated the same as an explicit return by inserting the same kind of store instructions. This special return variable would need to be created and managed for every call scope, with potential for optimizing it out in cases where it isn't used (such as explicitly returning from a Unit
-typed callable).