Show simple item record

dc.contributor.authorCooper, Keith D.
Harvey, Timothy J.
Waterman, Todd
dc.date.accessioned 2017-08-02T22:02:57Z
dc.date.available 2017-08-02T22:02:57Z
dc.date.issued 2002-02-01
dc.identifier.urihttps://hdl.handle.net/1911/96303
dc.description.abstract A variety of applications have arisen where it is worthwhile to apply code optimizations directly to the machine code (or assembly code) produced by a compiler. These include link-time whole-program analysis and optimization, code compression, binary- to-binary translation, and bit-transition reduction (for power). Many, if not most, optimizations assume the presence of a control-flow graph (cfg). Compiled, scheduled code has properties that can make cfg construction more complex than it is inside a typical compiler. In this paper, we examine the problems of scheduled code on architectures that have multiple delay slots. In particular, if branch delay slots contain other branches, the classic algorithms for building a cfg produce incorrect results. We explain the problem using two simple examples. We then present an algorithm for building correct cfgs from scheduled assembly code that includes branches in branch-delay slots. The algorithm works by building an approximate cfg and then refining it to reflect the actions of delayed branches. If all branches have explicit targets, the complexity of the refining step is linear with respect to the number of branches in the code. Analysis of the kind presented in this paper is a necessary first step for any system that analyzes or translates compiled, assembly-level code. We have implemented this algorithm in our power-consumption experiments based on the TMS320C6200 architecture from Texas Instruments. The development of our algorithm was motivated by the output of TI’s compiler.
dc.format.extent 10 pp
dc.language.iso eng
dc.rights You are granted permission for the noncommercial reproduction, distribution, display, and performance of this technical report in any format, but this permission is only for a period of forty-five (45) days from the most recent time that you verified that this technical report is still available from the Computer Science Department of Rice University under terms that include this permission. All other rights are reserved by the author(s).
dc.title Building a Control-flow Graph from Scheduled Assembly Code
dc.type Technical report
dc.date.note February 1, 2002
dc.identifier.digital TR02-399
dc.type.dcmi Text
dc.identifier.citation Cooper, Keith D., Harvey, Timothy J. and Waterman, Todd. "Building a Control-flow Graph from Scheduled Assembly Code." (2002) https://hdl.handle.net/1911/96303.


Files in this item

Thumbnail

This item appears in the following Collection(s)

Show simple item record