Each component binary in a heterogeneous program is translated from a
platform-specific instruction set into a set of intermediate
representation (IR) instructions that are platform-neutral. The IR
instructions are grouped into IR code blocks, the IR code blocks into IR
procedures, and the IR procedures into IR components to create an
intermediate representation hierarchy for the program. An application
program interface is provided that permits user access to the IR
hierarchy for instrumentation, optimization, navigation, and manipulation
of the IR hierarchy. The transformed IR hierarchy is then translated into
platform-specific instructions and output as a modified binary. The user
can designate a different platform for the output translation of a code
block than the platform for which the code block was originally written.
Prologue and epilog code is added to contiguous blocks that are
translated into different architectures. The modified binary can be
iterated through the translation and transformation process to produce
multiple versions of the heterogeneous program.