Playlist for all videos on this topic: • Compiler Design (COMPUTER SCIENCE) Vi...
Compiler Design lecture | Code Optimization | Target Machine Code Generation, Lexical Analysis, Syntax Analysis,Semantic Analysis, Intermediate Code Generation, Code Optimization
Target Machine Code Generation, machine-independent code-optimization phase attempts to improve the
intermediate code so that better target code will result. Usually better means faster, but other objectives may be desired, such as shorter code, or target code that consumes less power.The code generator takes as input an intermediate representation of the source
program and maps it into the target language. If the target language is machine
code, registers or memory locations are selected for each of the variables used by
the program. Then, the intermediate instructions are translated into sequences
of machine instructions that perform the same task.