Optimize away superfluous assignments