Predicated Instructions for Code Compaction
Procedural abstraction, the replacement of several identical code sequences with calls to a single representative function, is a powerful tool in producing compact executables. We explore how predicated instructions can be used to allow procedural abstraction of non-identical basic blocks. A predicated instruction is one that the processor executes if a condition (specified in the opcode) is true, otherwise the instruction has no effect. Architectures such as the ARM provide predicated versions of most of their instructions. By using predicated instructions within a representative function and setting the appropriate flags prior to the call, a single function can serve to represent several different code sequences.
To find representative functions, we group sequences that have a short common supersequence and use this supersequence as a representative. We report results on the use of predication for procedural abstraction on the ARM and also indicate the potential compaction benefit of allowing more predication conditions.
KeywordsBasic Block Code Size Code Fragment Longe Common Subsequence Register Allocation
Unable to display preview. Download preview PDF.
- 1.Allen, J.R., Kennedy, K., Porterfield, C., Warren, J.: Conversion of control dependence to data dependence. In: Proceedings of the 10th ACM Symposium on Principles of Programming Languages, pp. 177–189 (1983)Google Scholar
- 2.August, D.I.: Systematic Compilation for Predicated Execution. Ph.D thesis, University of Illinois at Urbana-Champaign (2000)Google Scholar
- 3.Cooper, K.D., McIntosh, N.: Enhanced code compression for embedded RISC processors. In: ACM Conference on Programming Language Design and Implementation, May 1999, pp. 139–149 (1999)Google Scholar
- 5.Fraser, C., Myers, E., Wendt, A.: Analyzing and compressing assembly code. In: Proc. of the ACM SIGPLAN Symposium on Compiler Construction, vol. 19, pp. 117–121 (1984)Google Scholar
- 7.Liao, S., Devadas, S., Keutzer, K.: Code density optimization for embedded DSP processors using data compression techniques. In: Proc. Conf. on Advanced Research in VLSI, pp. 393–399 (1995)Google Scholar
- 8.Mahlke, S.A., Hank, R.E., McCormick, J.E., August, D.I., Hwu, W.-m.W.: A comparison of full and partial predicated execution support for ILP processors. In: Proceedings of the 22nd Annual International Symposium on Computer Architecture, June 1995, pp. 138–149 (1995)Google Scholar
- 10.Runeson, J.: Code compression through procedural abstraction before register allocation. Master’s thesis, Computing Science Department, Uppsala University (March 2000)Google Scholar
- 11.Schwarz, B., Debray, S., Andrews, G., Legendre, M.: PLTO: A link-time optimizer for the Intel IA-32 architecture. In: Proc. 2001 Workshop on Binary Rewriting (WBT-2001) (September 2001)Google Scholar
- 12.Seal, D. (ed.): ARM Architecture Reference Manual, 2nd edn. Addison-Wesley, Reading (2001)Google Scholar
- 13.Vahid, F.: Procedure exlining: A transformation for improved system and behavioral synthesis. In: International Symposium on System Synthesis, September 1995, pp. 84–89 (1995)Google Scholar
- 14.Zastre, M.J.: Compacting object code via parameterized procedural abstraction. Master’s thesis, Dept. of Computing Science, University of Victoria (1995)Google Scholar