To solve this, heuristics can be used in order to approximate the solution. This is done by a graphing algorithm which we will discuss later in the article. Generate efficient target code in both time and spaceĬode generation is a tricky problem due to the high complexity of operations required and because code itself is extremely volatile since every intermediate code that the complier deals with will be different.Įach aspect of code generation involves a complicated process, for example, optimal register assignment is NP-Complete.Preserve original function of the program defined by programmer.To convert the optimised intermediate code into target code, the code generator generally carries out 3 tasks. It is part of the final stages of compilation, within the overall hierarchy of a compiler it is located between the optimisation steps. The code generator within a compiler is responsible for converting intermediate code to target code. We will explain various functions that the code generator can perform and an example of generation. In this article we will cover the basis of code generation within the compiler, how it works and its function. Pre-requisite: Graph Coloring Introduction In this article, we have explored Code Generation in Compiler Design in depth including challenges and key techniques like Instruction Selection, Register Allocation using Graph Coloring, Instruction Ordering and much more.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |