You can have LLMs help you optimize code but I don’t think you can do this unattended for non-trivial code.