-
Notifications
You must be signed in to change notification settings - Fork 701
Description
Would there be any immediate interest in adding an operator, say get_value, to duplicate a value from the expression stack?
With the post-order encoding there is already the issue that expression results accumulate in blocks to be discarded at the block exits. It seems consistent with the SSA decoder to allow re-use of these, so why not take advantage of them. Each of these could be viewed as binding a block local variable that could be accessed. So rather than block we could effective have let:
(let (($v1 (f64.load ...))
($v2 (i32.load ...))
(_ (f64.store :offset 8 (get_value $v2) (get_value $v1)))
(_ (f64.store :offset 16 (get_value $v2) (get_value $v1))))
;; The fall through result.
(get_value $v1))
Adding this now might allow some experimentation with the tooling, to take advantage of this.
It's not necessary to land this change, and it can be explored in local work, and local tools can rewrite the wast into this encoding, but might there happen to be any interesting in such an incremental change?