Building a Control-flow Graph from Scheduled Assembly Code

dc.contributor.authorCooper, Keith D.
dc.contributor.authorHarvey, Timothy J.
dc.contributor.authorWaterman, Todd
dc.date.accessioned2017-08-02T22:02:57Z
dc.date.available2017-08-02T22:02:57Z
dc.date.issued2002-02-01
dc.date.noteFebruary 1, 2002
dc.description.abstractA 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.extent10 pp
dc.identifier.citationCooper, Keith D., Harvey, Timothy J. and Waterman, Todd. "Building a Control-flow Graph from Scheduled Assembly Code." (2002) https://hdl.handle.net/1911/96303.
dc.identifier.digitalTR02-399
dc.identifier.urihttps://hdl.handle.net/1911/96303
dc.language.isoeng
dc.rightsYou 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.titleBuilding a Control-flow Graph from Scheduled Assembly Code
dc.typeTechnical report
dc.type.dcmiText
Files
Original bundle
Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
TR02-399.pdf
Size:
222.11 KB
Format:
Adobe Portable Document Format