Suppose at some point a classic algorithm can choose between doing 2 transforms. Both are correct, but one will lead to a better optimization than the other. You ask the LLM. No matter which one it chooses, you will get a correct output.
No, you use a profile-guided optimizer. Because you want that decision to be based on real empirical performance data, not a language model’s output based on conditional token probabilities.
You're still describing a compiler. You want that decision to be deterministic. An LLM is a really bad solution for such a problem.