Improve block splitting and phi patching