Implement drop removal. Currently only used for removing the useless sets generated by the liveness check, but could be quite easily generalised if need be. If removing a useless set creates more of them, removes them too without needing to recompute liveness.
Here's the same example from before:
function addTwo(x, y)
res = 10+x
t = 10+x
r = 431*y
p = t*r
q = p+2
return res
end
Implement drop removal. Currently only used for removing the useless sets generated by the liveness check, but could be quite easily generalised if need be. If removing a useless set creates more of them, removes them too without needing to recompute liveness.
Here's the same example from before:
The unnecessary calculation of
q
is completely removed:Putting it all together then, the function is reduced to the following: