Action Transformations in the ACTRESS Compiler Generator Hermano Mourn*, David A. Watt** Abstract. Given the action-semantic description of a source language, ACTRESS generates a compiler. The generated compiler translates its source program first to an action, and then to object code. Transfor- mations of the intermediate action greatly improve the efficiency of the object code. This paper studies these transformations. 1 Introduction ACTRESS [2] is an action-semantics directed compiler generator. That is to say, it accepts a formal description of the syntax and action semantics of a particu- lar programming language, the source language, and from this it automatically generates a compiler that translates the source language to C object code. The generated compiler translates each source program to an action, which we call the program action, and thereafter translates the program action to object code. We have used ACTRESS to generate compilers for a small functional language, MINI-ML, and a small imperative language, MINI-A. The preliminary version of ACTRESS[2] generated compilers whose object code was rather inefficient. However, significant improvements have since been achieved. Inspection of typical program actions reveals many opportunities for sim- plification. For example, actions obey simple algebraic laws [7], which can be exploited to simplify them. However, more sophisticated transformations are needed to achieve major simplifications. Our recent work has been directed to discovering, formalising, and implementing such transformations. Our ultimate aim is to make ACTRESS generate compilers whose object code is only about 2-4 times slower than that of hand-crafted compilers. This paper describes our recent work. The rest of the paper is structured as follows. Section 2 is a very brief summary of the ACTRESS subset of action notation. Section 3 is a brief description of ACTaESS itself. Section 4 motivates the need for action transformations in generated compilers, focusing on algebraic simplification, transient elimination, binding elimination, and storage allocation. Section 5 shows how we formalise these transformations. Section 6 outlines how we implement them, and includes a worked example of action transformations in the generated MINI-/k compiler. Section 7 concludes. Appendix A outlines an Caixa EconSmica Federal, Brazil. E-mail: hermano@di.ufpe.br. Work supported by CNPq, Brazil. ** Department of Computing Science, University of Glasgow, Glasgow G12 8QQ, Scot- land. E-mail: daw@dcs.glasgow, ac.uk.