Register allocation and exhaustive peephole optimization
Jack W. Davidson, Christopher W. Fraser · Software Practice and Experience · 1984
Abstract Emerging peephole optimizers can relieve code generators of much case analysis, but delaying code generation decisions requires register allocation algorithms that accept object code instead of the more usual intermediate code. This paper describes two programs that implement such algorithms for a retargetable optimizing compiler. In a machine‐independent fashion, they allocate and assign registers, eliminate common subexpressions (including often‐missed machine‐specific ones), identify dead variables, and define windows for the companion peephole optimizer. Their techniques for handling machine‐specific data should generalize to other optimizations as well.