US 11,755,299 B2
Method and apparatus for functional unit balancing at program compile time
Tomasz S. Czajkowski, Toronto (CA); and Ehsan Amiri, Richmond Hill (CA)
Assigned to Huawei Technologies Co., Ltd., Shenzhen (CN)
Filed by Huawei Technologies Co., Ltd., Shenzhen (CN)
Filed on Jun. 23, 2021, as Appl. No. 17/355,737.
Prior Publication US 2022/0413818 A1, Dec. 29, 2022
Int. Cl. G06F 8/41 (2018.01)
CPC G06F 8/4441 (2013.01) 27 Claims
OG exemplary drawing
 
1. A method for compiling source code, comprising:
selecting an instruction from the source code;
determining a first functional unit on which the instruction is to be performed;
determining that the first functional unit is overloaded;
determining that replacement instructions are beneficial over the instruction, wherein the determining that the replacement instructions are beneficial over the instruction comprises:
evaluating a first scenario in which a cluster of instructions comprises the replacement instructions, and
evaluating a second scenario in which the cluster of instructions comprises the instruction;
after the determining that the replacement instructions are beneficial over the instruction, transforming the source code by replacing the instruction with the replacement instructions to generate transformed source code, the replacement instructions being selected to be performed on a second functional unit; and
converting the transformed source code into machine-executable instructions,
wherein the replacement instructions are functionally equivalent to the instruction.