1. A method comprising: building, on a computer, at least one intermediate representation (IR) including a specification for two or more components and a plurality of interconnections between the two or more components; storing the at least one IR in a memory; analyzing, on the computer, a first component and a second component of the at least one IR, the first and second components connected to one another, and the analyzing comprising determining a first condition in which the first component passes a functional equivalence retiming test; determining a second condition in which the second component fails a functional equivalence retiming test; when the first and second conditions are determined to exist, then using the connection between the first and second component as a boundary for partitioning the at least one IR into a first partitioned portion that includes the first component that passes the functional equivalence retiming test and a second partitioned portion that includes the second component that fails the functional equivalence retiming test; and rearranging, on the computer, at least one or more of the components in the first partitioned portion of the at least one IR, to obtain a retimed IR, the retimed IR having a retimed execution order that has functional equivalence with the at least one IR.