optimize next_use calculation (quadratic in number of outs not number of nodes in...