优化和生成review

优化和生成review

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Code optimization Optimization is the process of transforming a piece of code to make it more efficient (either in terms of time or space) without changing its output or side-effects. The only difference visible to the code’s user should be that it runs faster and/or consumes less memory.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Code optimization Optimization is the field where most compiler research is done today. High-quality optimization is more of an art than a science. Many optimization problems are NP-complete and thus most optimization algorithms rely on heuristics and approximations. It may be possible to come up with a case where a particular algorithm fails to produce better code or perhaps even makes it worse. However, the algorithms tend to do rather well overall.
Background image of page 2
When and in what representation to optimize There are a variety of tactics for attacking optimization. Some techniques are applied to the intermediate code, Others are applied as part of final code generation—choosing which instructions to emit, how to allocate registers … And still other optimizations may occur after final code generation,
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2011 for the course CS Compile taught by Professor Weizhong during the Spring '05 term at Fudan University.

Page1 / 10

优化和生成review

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online