One of the purposes of using intermediate code in compilers is to:
increase the chances of reusing the machine-independent code optimizer in other compilers.
Intermediate code provides an abstraction that is closer to the source language than the target machine language. It allows for a machine-independent representation of the program, making it easier to implement and reuse optimization techniques that are independent of the specific target architecture.
This facilitates the development of machine-independent optimization passes that can be shared among different compilers targeting various architectures. It promotes code optimization at a higher level of abstraction, reducing the need for target-specific optimizations in the early stages of the compilation process.