@whitequark @mcc Also (maybe relevant for the JIT comment): the stack at any given point *is* the set of live variables.
If you calculate a kind of "virtual stack" for a given basic block you will end up with the amount of elements that it pops from the stack (phi nodes/basic block arguments/whatever you want to call them) and the amount of elements it adds to the stack at the end of its execution (values that will be consumed by another block).