|
11.11 SummaryA statement by statement code generator tends to produce poor code, where by "good" code we mean code that executes fast or takes up less space. To produce better code, code generation avoids extra computation, reusing computed values (common subexpressions) if reuse is less expensive than recomputing. Further efficiency can be achieved by avoiding extra loads, unnecessary stores, avoidable register-to-register moves, and special instructions. A good code generator design, like all software, is easier to implement, easier to test, and easier to maintain. |