The Imp pass has not done long-range destination passing for some time. Every destination passed to a Block was always interpreted as applying only to the result of the block (i.e., Imp did not have an equivalent to decomposeDest from Lower). Since block results are Atoms, no non-Atom expression ever got a non-Nothing destination passed to it in Imp. Ergo, the only thing all the Maybe Dest arguments were accomplishing was supporting the handful of constructs that can return values in SimpIR but cannot return values in Imp (i.e., case, runWriter, runState) by locally allocating a destination and immediately writing to it. So this PR just deletes all that machinery and codes that locally.
The Imp pass has not done long-range destination passing for some time. Every destination passed to a Block was always interpreted as applying only to the result of the block (i.e., Imp did not have an equivalent to decomposeDest from Lower). Since block results are Atoms, no non-Atom expression ever got a non-Nothing destination passed to it in Imp. Ergo, the only thing all the
Maybe Dest
arguments were accomplishing was supporting the handful of constructs that can return values in SimpIR but cannot return values in Imp (i.e., case, runWriter, runState) by locally allocating a destination and immediately writing to it. So this PR just deletes all that machinery and codes that locally.