Peephole optimizers improve object code by replacing certain sequences of instructions with better sequences. This paper describes PO, a peephole optimizer that uses a symbolic machine description to simulate pairs of adjacent instructions, replacing them, where possible, with an equivalent single instruction. As a result of this organization, PO is machine independent and can be described formally and concisely: when PO is finished, no instruction, and no pair of adjacent instructions, can be replaced with a cheaper single instruction that has the same effect. This thoroughness allows PO to relieve code generators of much case analysis; for example, they might produce only load/add-register sequences and rely on PO to, where possible, discard them in favor or add-memory, add-immediate, or increment instructions. Experiments indicate that naive code generators can give good code if used with PO. © 1980, ACM. All rights reserved.
CITATION STYLE
Davidson, J. W., & Fraser, C. W. (1980). The Design and Application of a Retargetable Peephole Optimizer. ACM Transactions on Programming Languages and Systems (TOPLAS), 2(2), 191–202. https://doi.org/10.1145/357094.357098
Mendeley helps you to discover research relevant for your work.