Abstract
Many compilers for higher order languages attempt to translate the source code into “good” object code. Cocke and Schwartz have described an algorithm for discovering when the computation of an expression is redundant (common), and when it can be moved to a less frequently executed region of the program. The present paper includes a tutorial presentation of their basic methods, along with a number of improvements and extensions. These include simplification of the solution method, to save a pass; extension of it to treat the safety constraint, handle multi-entry regions directly, detect additional commonality and code motion after unsafe code motion, and decide where moved code should be put; and combination of the algorithms for commonality and the dead condition, making use of important work of Ken Kennedy. The methods here applied to collecting information for use in code optimization include general algorithms for solving a set of linear equations in Boolean algebra. The algorithms are most useful when the coefficient matrix is sparse.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.