A Dynamic Programming Approach to Optimal Integrated Code Generation

Christoph Keßler, Andrzej Bednarski
<span title="">2001</span> <i title="ACM Press"> <a target="_blank" rel="noopener" href="https://fatcat.wiki/container/6dcohyzfhveypik7x4entpurlu" style="color: black;">Proceedings of the ACM SIGPLAN workshop on Languages, compilers and tools for embedded systems - LCTES &#39;01</a> </i> &nbsp;
Phase-decoupled methods for code generation are the state of the art in compilers for standard processors but generally produce code of poor quality for irregular target architectures such as many DSPs. In that case, the generation of efficient code requires the simultaneous solution of the main subproblems instruction selection, instruction scheduling, and register allocation, as an integrated optimization problem. In contrast to compilers for standard processors, code generation for DSPs can
more &raquo; ... fford to spend much higher resources in time and space on optimizations. Today, most approaches to optimal code generation are based on integer linear programming, but these are either not integrated or not able to produce optimal solutions except for very small problem instances. We report on research in progress on a novel method for fully integrated code generation that is based on dynamic programming. In particular, we introduce the concept of a time profile. We focus on the basic block level where the data dependences among the instructions form a DAG. Our algorithm aims at combining timeoptimal scheduling with optimal instruction selection, given a limited number of general-purpose registers. An extension for irregular register sets, spilling of register contents, and intricate structural constraints on code compaction based on register usage is currently under development, as well as a generalization for global code generation. A prototype implementation is operational, and we present first experimental results that show that our algorithm is practical also for medium-size problem instances. Our implementation is intended to become the core of a future, retargetable code generation system.
<span class="external-identifiers"> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.1145/384197.384219">doi:10.1145/384197.384219</a> <a target="_blank" rel="external noopener" href="https://dblp.org/rec/conf/lctrts/KesslerB01.html">dblp:conf/lctrts/KesslerB01</a> <a target="_blank" rel="external noopener" href="https://fatcat.wiki/release/ueiszu5rc5am3h2ouuxirzejca">fatcat:ueiszu5rc5am3h2ouuxirzejca</a> </span>
<a target="_blank" rel="noopener" href="https://web.archive.org/web/20170830013138/http://www.ida.liu.se/~chrke55/ceniit/finlctes.pdf" title="fulltext PDF download" data-goatcounter-click="serp-fulltext" data-goatcounter-title="serp-fulltext"> <button class="ui simple right pointing dropdown compact black labeled icon button serp-button"> <i class="icon ia-icon"></i> Web Archive [PDF] <div class="menu fulltext-thumbnail"> <img src="https://blobs.fatcat.wiki/thumbnail/pdf/8f/b3/8fb3da1beb53376455a2de7e79be6295c0d7d9dc.180px.jpg" alt="fulltext thumbnail" loading="lazy"> </div> </button> </a> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.1145/384197.384219"> <button class="ui left aligned compact blue labeled icon button serp-button"> <i class="external alternate icon"></i> acm.org </button> </a>