Patent attributes
In an embodiment, a code generator receives input code having a plurality of functional elements, such as blocks, nodes, statements, commands, etc. The input code processes a data set, such as an image file. The code generator further receives one or more criteria for the generated code. The functional elements of the input code are provided with one or more parameters regarding the block sizes that the respective functional elements can process, such as an available block size and a preferred block size. The code generator queries the functional elements of the input code to obtain their available and preferred block sizes, and builds an intermediate representation (IR) of the input code. The code generator re-organizes and modifies the IR so that it achieves the one or more criteria. Output code that meets the one or more criteria is generated from the reorganized and modified IR.