Cross module representation of heterogeneous programs
AssigneeMicrosoft Corporation
InventorsAmitabh Srivastava, Hoi H. Vo
Life of this patent
Estimating the term…
Abstract
An output translator provides for cross module representations of components within a heterogeneous program by translating modifying a platform-neutral intermediate representation (IR) of the program into platform-specific instructions for different architectures. The intermediate representation is hierarchy of base elements that correspond to instructions, code blocks, procedures and components within the program. Blocks of instructions that were originally written for one architecture can be translated from the intermediate representation into platform-specific instructions for a different architecture. The output translator provides any necessary code to interface contiguous code blocks that are emitted in different instruction sets.
Claims24
A computerized method for translating a heterogeneous program into different architectures comprising:
- reading a heterogeneous program having a plurality of executable components in different forms;
- obtaining a platform-neutral intermediate representation of a component in the heterogeneous program;
- creating logical linkages among a plurality of code blocks in the intermediate representation of the component to establish a control flow through the component;
- assigning an absolute address within an address space for the component to each of the plurality of code blocks;
- resolving the logical linkages to the absolute addresses for the corresponding code blocks;
- emitting a platform-specific executable instruction for each instruction represented in the intermediate representation of the component into a buffer;
- and
- writing the buffer to an output file to create a new version of the component.
A computer-readable medium having computer-executable instructions to cause a computer to perform an output translation method on an intermediate representation for a component comprising:
- resolving logical references within the intermediate representation to absolute addresses in an address space for the component;
- emitting instructions for the component in a plurality of platform-specific instruction sets defined by the intermediate representation;
- and
- inserting interface instructions in the intermediate representation between code blocks marked to be emitted in different platform-specific instruction sets, the interface instructions enabling a transition from one platform-specific instruction set to a different platform-specific instruction set.
A computer-readable medium having stored thereon an emitted block information data structure for describing a code block emitted by a cross-module representation system, the data structure comprising:
- an address field containing data representing a starting address for the emitted block;
- a size field containing data representing a size of the block starting at the address in the address field;
- a flag field containing data representing a set of information flags for the block starting at the address in the address field;
- and
- a symbol entry containing data representing a symbol name and a symbol address for a symbol appearing in the block starting at the address in the address field, wherein the emitted block and the data structure are accessible by the cross-module representation system to facilitate optimization of the emitted block.
A computerized system comprising:
- a processing unit;
- a system memory coupled to the processing unit through a system bus;
- a computer-readable medium coupled to the processing unit through a system bus;
- a reader module reading a heterogeneous program comprising a plurality of executable components written for two or more computer architectures;
- a platform-neutral intermediate representation of the heterogeneous program in the system memory;
- and
- an output translator module executed from the computer-readable medium by the processing unit, wherein the output translator module causes the processing unit to translate the intermediate representation into a set of platform-specific instructions that accomplish the function of the heterogeneous program.
A computer-readable medium having computer-executable instructions stored thereon for performing a method comprising:
- reading a heterogeneous program comprising a plurality of executable components written in two or more instruction sets;
- translating an intermediate representation of the heterogeneous program into a set of platform-specific instructions;
- and
- writing the platform-specific instructions onto a computer-readable medium to create a new version of the heterogeneous program.
Dependencies are inferred from the claim text.