FrameReification

struct FrameReification

Tracks cross-region values that must be reified in a function frame and provides the metadata required to rewrite their uses.

A “region”, in this context, is a set of instructions (maybe from different blocks). For example, the instructions from the beginning of a simple projection to the yield form a region (the ramp), and the instructions from the yield to the end of the projection form another region (the slide).

If one instruction from the slide of the projection uses the value of an instruction from the ramp, the value must be reified in a frame that is passed from the ramp to the slide. The frame reification is the process of detecting which values need to be reified into a frame and performing the appropriate transformations, such as creating the frame storage and replacing the relevant instructions to access the frame.

We say that an instruction is “frame-backed” if its value is stored in the frame.