Compilers are often constrained to optimizations that are logically equivalent, for example bitshifting an unsigned integer is equivalent to multiplying or dividing it by the same power of two.
Given the stochastic nature of LLMs, it's both harder to prove a result is objectively correct and harder to coerce them to faithfully follow your instructions.