Add missing EnsureRegister optimization.