Date of Award
Master of Arts (MA)
Producing compilers for high level computer languages is difficult. The early phases of the compiler, syntactical and lexical analysis, are well understood and have been automated. Code generation is more ad-hoc in both design and implementation. The code generators in use may be sufficiently complex that the output could benefit from additional optimization. This thesis describes current efforts . to produce peephole optimizers which perform optimizations on the compiler output. A case is presented for basing optimizations on human written rules. A peephole optimizer generator is presented which reads a rule language which includes regular expressions and produces an executable program which operates on the assembly language output from a compiler. The resultant program, named OP, implements the guidelines specified in the original specification. Pattern matching is used within OP to track both register assignments and the matching of rules. Therefore, regular expression notation is sufficient for generating peephole optimizers.
Mahoney, Bill, "Peephole optimization of assembly language using regular expression pattern matching." (1990). Student Work. 3585.