Optimized IP instruction generation